entitlements-gitrepo-auditor-plugin 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 455dd4cda4e2c0ff4a773fcbcd338ad6740c8a95c3b9a8ac0d83b74fabc5b66d
4
- data.tar.gz: 403c4a015ec1194ec2893d9cda6e08899ff7c3f4b8e18204a5fee5bf997d1bfd
3
+ metadata.gz: cec2139fc013bc07143df36a94c202b19885c321a865dc04f4cc4b7fcd89ff84
4
+ data.tar.gz: 322e32c601936b2c92e5e0fd75eba4d45e47f9f6c71a288615dd9a190f7cf935
5
5
  SHA512:
6
- metadata.gz: c3658fb94cc8688456e4ff749c9c632657afffc0a2522e53a7c5d4fd79ef93dad35f303d8ed14e3d2fe08fdce391ac914b2220e4ac9b63bba0b6aac978599b72
7
- data.tar.gz: 3c4d4c59d9d335017255f9db3cb72467b5573b870ed10218c36d2213216901cf01a7200d9aa0c749626d96aedb7113292433206812aa1db3819601e78a92abcf
6
+ metadata.gz: d8c2c6cba3b20be04281e9841ecee40fe64489d1e359aa79fdadaf3fec3c5c578b11a5141696f0560a27a9891a6f24c5ac3ceda6ddc4a5ad2c95322abb43c002
7
+ data.tar.gz: 7a38198735a8e682a562ed4f711d0c9e8e8167b9b8d543930e51bafce3c0fba4ebb0286799ce28f8c5246abc2c1bf785aa3e98bbfca5344107f73c1e748f582d
@@ -26,7 +26,7 @@ module Entitlements
26
26
  @repo = Entitlements::Util::GitRepo.new(
27
27
  repo: config["repo"],
28
28
  sshkey: Base64.decode64(config["sshkey"]),
29
- logger: logger
29
+ logger:
30
30
  )
31
31
  @repo.github = config["github_override"] if config["github_override"]
32
32
  @repo.send(operation, checkout_directory)
@@ -59,10 +59,10 @@ module Entitlements
59
59
  %w[update_files delete_files].each do |m|
60
60
  send(
61
61
  m.to_sym,
62
- action_hash: action_hash,
63
- successful_actions: successful_actions,
64
- sync_changes: sync_changes,
65
- valid_changes: valid_changes
62
+ action_hash:,
63
+ successful_actions:,
64
+ sync_changes:,
65
+ valid_changes:
66
66
  )
67
67
  end
68
68
 
@@ -38,6 +38,7 @@ module Entitlements
38
38
  @repo = repo
39
39
  @sshkey = sshkey
40
40
  @github = "git@github.com:"
41
+ @tmpdir_prefix = ENV.fetch("ENTITLEMENTS_TMPDIR_PREFIX", "/data/entitlements_deploys")
41
42
  end
42
43
 
43
44
  # Run "git add" on a file.
@@ -79,7 +80,11 @@ module Entitlements
79
80
  Contract String, String => nil
80
81
  def commit(dir, commit_message)
81
82
  validate_git_repository!(dir)
82
- git(dir, ["commit", "-m", commit_message])
83
+ begin
84
+ git(dir, ["commit", "-m", commit_message])
85
+ rescue Entitlements::Util::GitRepo::CommandError
86
+ logger.info "No changes to git repository"
87
+ end
83
88
  nil
84
89
  end
85
90
 
@@ -202,7 +207,11 @@ module Entitlements
202
207
  # else custom that might be going on in the environment. Turn off prompts for the SSH key for
203
208
  # github.com being trusted or not, only use the provided key as the identity, and ignore any
204
209
  # ~/.ssh/config file the user running this might have set up.
205
- tempdir = Dir.mktmpdir
210
+
211
+ # if the @tmpdir_prefix doesn't exist, create it
212
+ FileUtils.mkdir_p(@tmpdir_prefix) unless File.directory?(@tmpdir_prefix)
213
+ tempdir = Dir.mktmpdir(nil, @tmpdir_prefix)
214
+
206
215
  File.open(File.join(tempdir, "key"), "w") { |f| f.write(sshkey) }
207
216
  File.open(File.join(tempdir, "ssh"), "w") do |f|
208
217
  f.puts "#!/bin/sh"
data/lib/version.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Entitlements
4
+ module Version
5
+ VERSION = "0.3.0"
6
+ end
7
+ end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entitlements-gitrepo-auditor-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc. Security Ops
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2023-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: entitlements
14
+ name: contracts
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: '0.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: '0.17'
27
27
  - !ruby/object:Gem::Dependency
28
- name: contracts
28
+ name: entitlements
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '0.17'
33
+ version: 0.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '0.17'
40
+ version: 0.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +192,20 @@ dependencies:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
194
  version: 3.4.2
195
- description: ''
195
+ description: Entitlements plugin for a robust audit log
196
196
  email: opensource+entitlements-app@github.com
197
197
  executables: []
198
198
  extensions: []
199
199
  extra_rdoc_files: []
200
200
  files:
201
- - VERSION
202
201
  - lib/entitlements/auditor/gitrepo.rb
203
202
  - lib/entitlements/util/gitrepo.rb
203
+ - lib/version.rb
204
204
  homepage: https://github.com/github/entitlements-gitrepo-auditor-plugin
205
205
  licenses:
206
206
  - MIT
207
207
  metadata: {}
208
- post_install_message:
208
+ post_install_message:
209
209
  rdoc_options: []
210
210
  require_paths:
211
211
  - lib
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  requirements: []
223
223
  rubygems_version: 3.3.7
224
- signing_key:
224
+ signing_key:
225
225
  specification_version: 4
226
226
  summary: Entitlements GitRepo Auditor
227
227
  test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.0