vtk 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0585f00ec9fe122942c5a249fd2733e47baa461960cc9d106e2dfb9ac13dc3aa'
4
- data.tar.gz: c23b728a27d519e15812f8b95ffcf7e0aac20981e38cab59dca62c4a62582f21
3
+ metadata.gz: 5cdbc7b68bcc69890c11e5ac9e9db8b14c224616d223fe02309b329c12c52783
4
+ data.tar.gz: 777d7543e02729b297de739b379e55dcd954e1403f8d81d3f142fa9f33afd9f6
5
5
  SHA512:
6
- metadata.gz: 0d10b96103db87af8754a1a1a3cb0fc6a268255f9c596baccf730f73c8a8ba03598a84cdcc8de35a53114710fe546e572a8f7ca4706efc8c45e7de3ce28aa115
7
- data.tar.gz: 9e78a14e489d84f99a81725f7f93c03c3356d7165d7d79c871ade2cb61f2d462f8dae315f8b1f570ae7db4e84f0e9f0b4d7706f4d06dcc2c4622272025edf18d
6
+ metadata.gz: 0c99ba6157bf038dbcca4510a7b1443aa1de2896404d066852b18822af9f2ef07778f55efa73f5c0df738dc69f9d6fb38c4cfabef986d66d0a7a99a9d183dd4a
7
+ data.tar.gz: c8af1ce8914b585ef40002a15576a08011fa49a7d258b65ffe37c565b6a1b9d804d7d1b6c686451e09a3994db1e3aca332609e8b20926cdc37e974129686d4c7
data/CHANGELOG.md CHANGED
@@ -1,14 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.3.0](https://github.com/department-of-veterans-affairs/vtk/tree/v1.3.0) (2026-04-14)
4
+
5
+ [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v1.2.0...v1.3.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - feat\(scan\): add vtk scan actions for tracing GitHub Actions usage [\#72](https://github.com/department-of-veterans-affairs/vtk/pull/72) ([ericboehs](https://github.com/ericboehs))
10
+
3
11
  ## [v1.2.0](https://github.com/department-of-veterans-affairs/vtk/tree/v1.2.0) (2026-01-09)
4
12
 
5
13
  [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v1.1.0...v1.2.0)
6
14
 
7
15
  **Merged pull requests:**
8
16
 
9
- - feat(scan): add PowerShell scripts for Windows users [\#69](https://github.com/department-of-veterans-affairs/vtk/pull/69) ([ericboehs](https://github.com/ericboehs))
10
- - feat(scan): add vtk scan credentials for security incident response [\#68](https://github.com/department-of-veterans-affairs/vtk/pull/68) ([ericboehs](https://github.com/ericboehs))
11
- - feat(scan): add vtk scan repo for compromised package detection [\#65](https://github.com/department-of-veterans-affairs/vtk/pull/65) ([ericboehs](https://github.com/ericboehs))
17
+ - chore: release v1.2.0 [\#70](https://github.com/department-of-veterans-affairs/vtk/pull/70) ([ericboehs](https://github.com/ericboehs))
18
+ - feat\(scan\): add PowerShell scripts for Windows users [\#69](https://github.com/department-of-veterans-affairs/vtk/pull/69) ([ericboehs](https://github.com/ericboehs))
19
+ - feat\(scan\): add vtk scan credentials for security incident response [\#68](https://github.com/department-of-veterans-affairs/vtk/pull/68) ([ericboehs](https://github.com/ericboehs))
20
+ - feat\(scan\): add vtk scan repo for compromised package detection [\#65](https://github.com/department-of-veterans-affairs/vtk/pull/65) ([ericboehs](https://github.com/ericboehs))
12
21
 
13
22
  ## [v1.1.0](https://github.com/department-of-veterans-affairs/vtk/tree/v1.1.0) (2025-12-15)
14
23
 
@@ -16,16 +25,25 @@
16
25
 
17
26
  **Merged pull requests:**
18
27
 
19
- - feat(scan): add vtk scan machine for Shai-Hulud detection [\#64](https://github.com/department-of-veterans-affairs/vtk/pull/64) ([ericboehs](https://github.com/ericboehs))
28
+ - chore: bump version to 1.1.0 [\#67](https://github.com/department-of-veterans-affairs/vtk/pull/67) ([ericboehs](https://github.com/ericboehs))
20
29
  - fix: resolve rubocop offenses in socks/setup.rb [\#66](https://github.com/department-of-veterans-affairs/vtk/pull/66) ([ericboehs](https://github.com/ericboehs))
21
- - Fix rubocop exceptions and update GH to run on Ubuntu Latest [\#63](https://github.com/department-of-veterans-affairs/vtk/pull/63) ([ericboehs](https://github.com/ericboehs))
30
+ - feat\(scan\): add vtk scan machine for Shai-Hulud detection [\#64](https://github.com/department-of-veterans-affairs/vtk/pull/64) ([ericboehs](https://github.com/ericboehs))
31
+ - Update GH to run on Ubuntu Latest [\#63](https://github.com/department-of-veterans-affairs/vtk/pull/63) ([ericboehs](https://github.com/ericboehs))
22
32
 
23
33
  ## [v1.0.0](https://github.com/department-of-veterans-affairs/vtk/tree/v1.0.0) (2024-09-18)
24
34
 
25
- 🎉
26
-
27
35
  [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v0.9.5...v1.0.0)
28
36
 
37
+ **Closed issues:**
38
+
39
+ - Error: GitHub Repository Not Mapped To eMASS System [\#59](https://github.com/department-of-veterans-affairs/vtk/issues/59)
40
+ - Error: GitHub Repository Not Mapped To eMASS System [\#58](https://github.com/department-of-veterans-affairs/vtk/issues/58)
41
+ - Error: GitHub Repository Not Mapped To eMASS System [\#57](https://github.com/department-of-veterans-affairs/vtk/issues/57)
42
+ - Error: GitHub Repository Not Mapped To eMASS System [\#56](https://github.com/department-of-veterans-affairs/vtk/issues/56)
43
+ - Error: GitHub Repository Not Mapped To eMASS System [\#55](https://github.com/department-of-veterans-affairs/vtk/issues/55)
44
+ - Error: GitHub Repository Not Mapped To eMASS System [\#54](https://github.com/department-of-veterans-affairs/vtk/issues/54)
45
+ - Error: GitHub Repository Not Mapped To eMASS System [\#51](https://github.com/department-of-veterans-affairs/vtk/issues/51)
46
+
29
47
  **Merged pull requests:**
30
48
 
31
49
  - fix: OpenStruct is no longer auto required in Ruby 3.2 [\#62](https://github.com/department-of-veterans-affairs/vtk/pull/62) ([ericboehs](https://github.com/ericboehs))
@@ -35,6 +53,26 @@
35
53
 
36
54
  [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v0.9.4...v0.9.5)
37
55
 
56
+ **Closed issues:**
57
+
58
+ - Error: GitHub Repository Not Mapped To eMASS System [\#50](https://github.com/department-of-veterans-affairs/vtk/issues/50)
59
+ - Error: GitHub Repository Not Mapped To eMASS System [\#49](https://github.com/department-of-veterans-affairs/vtk/issues/49)
60
+ - Error: GitHub Repository Not Mapped To eMASS System [\#48](https://github.com/department-of-veterans-affairs/vtk/issues/48)
61
+ - Error: GitHub Repository Not Mapped To eMASS System [\#47](https://github.com/department-of-veterans-affairs/vtk/issues/47)
62
+ - Error: GitHub Repository Not Mapped To eMASS System [\#46](https://github.com/department-of-veterans-affairs/vtk/issues/46)
63
+ - Error: GitHub Repository Not Mapped To eMASS System [\#45](https://github.com/department-of-veterans-affairs/vtk/issues/45)
64
+ - Error: GitHub Repository Not Mapped To eMASS System [\#44](https://github.com/department-of-veterans-affairs/vtk/issues/44)
65
+ - Error: GitHub Repository Not Mapped To eMASS System [\#43](https://github.com/department-of-veterans-affairs/vtk/issues/43)
66
+ - Error: GitHub Repository Not Mapped To eMASS System [\#42](https://github.com/department-of-veterans-affairs/vtk/issues/42)
67
+ - Error: GitHub Repository Not Mapped To eMASS System [\#41](https://github.com/department-of-veterans-affairs/vtk/issues/41)
68
+ - Error: GitHub Repository Not Mapped To eMASS System [\#40](https://github.com/department-of-veterans-affairs/vtk/issues/40)
69
+ - Error: GitHub Repository Not Mapped To eMASS System [\#39](https://github.com/department-of-veterans-affairs/vtk/issues/39)
70
+ - Error: GitHub Repository Not Mapped To eMASS System [\#38](https://github.com/department-of-veterans-affairs/vtk/issues/38)
71
+ - Error: GitHub Repository Not Mapped To eMASS System [\#37](https://github.com/department-of-veterans-affairs/vtk/issues/37)
72
+ - Error: GitHub Repository Not Mapped To eMASS System [\#36](https://github.com/department-of-veterans-affairs/vtk/issues/36)
73
+ - Error: GitHub Repository Not Mapped To eMASS System [\#35](https://github.com/department-of-veterans-affairs/vtk/issues/35)
74
+ - Notice: Automatic archival of repository due to inactivity [\#34](https://github.com/department-of-veterans-affairs/vtk/issues/34)
75
+
38
76
  **Merged pull requests:**
39
77
 
40
78
  - Add sudo to proxy setup command for MacOS. [\#52](https://github.com/department-of-veterans-affairs/vtk/pull/52) ([omahane](https://github.com/omahane))
data/lib/vtk/cli.rb CHANGED
@@ -9,7 +9,7 @@ module Vtk
9
9
  # @api public
10
10
  class CLI < Thor
11
11
  # Error raised by this runner
12
- Error = Class.new(StandardError)
12
+ class Error < StandardError; end
13
13
 
14
14
  desc 'version', 'vtk version'
15
15
  def version
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'English'
4
+ require_relative '../../command'
5
+
6
+ module Vtk
7
+ module Commands
8
+ class Scan
9
+ # Trace direct and transitive uses of GitHub Actions across an org.
10
+ # Shells out to gh-action-trace.sh for the actual work.
11
+ class Actions < Vtk::Command
12
+ BOOLEAN_FLAGS = {
13
+ external: '--external',
14
+ quiet: '--quiet',
15
+ verbose: '--verbose'
16
+ }.freeze
17
+
18
+ VALUE_FLAGS = {
19
+ org: '--org',
20
+ depth: '--depth',
21
+ format: '--format',
22
+ output: '--output',
23
+ check_runs: '--check-runs'
24
+ }.freeze
25
+
26
+ attr_reader :options
27
+
28
+ def initialize(options)
29
+ @options = options
30
+ super()
31
+ end
32
+
33
+ def execute(output: $stdout)
34
+ error = validation_error
35
+ return error_out(output, error) if error
36
+
37
+ script_path, gem_root = find_script
38
+ return script_not_found(output, gem_root) unless script_path
39
+
40
+ run_script(script_path)
41
+ end
42
+
43
+ private
44
+
45
+ def validation_error
46
+ return 'ERROR: --org is required' if blank?(options[:org])
47
+ return 'ERROR: --action is required (at least one)' if blank?(options[:action])
48
+
49
+ nil
50
+ end
51
+
52
+ def blank?(value)
53
+ value.nil? || value.to_s.empty? || (value.respond_to?(:empty?) && value.empty?)
54
+ end
55
+
56
+ def error_out(output, message)
57
+ output.puts message
58
+ 1
59
+ end
60
+
61
+ def script_not_found(output, gem_root)
62
+ output.puts 'ERROR: Could not find gh-action-trace.sh script'
63
+ output.puts "Expected at: #{gem_root}/scripts/gh-action-trace.sh"
64
+ 1
65
+ end
66
+
67
+ def run_script(script_path)
68
+ cmd = ['bash', script_path] + script_options
69
+ system(*cmd)
70
+ $CHILD_STATUS.exitstatus
71
+ end
72
+
73
+ def script_options
74
+ boolean_script_flags + value_script_flags + action_script_flags
75
+ end
76
+
77
+ def boolean_script_flags
78
+ BOOLEAN_FLAGS.select { |key, _| options[key] }.values
79
+ end
80
+
81
+ def value_script_flags
82
+ VALUE_FLAGS.flat_map do |key, flag|
83
+ value = options[key]
84
+ blank?(value) ? [] : [flag, value.to_s]
85
+ end
86
+ end
87
+
88
+ def action_script_flags
89
+ Array(options[:action]).flat_map { |action| ['--action', action] }
90
+ end
91
+
92
+ def find_script
93
+ # __dir__ = lib/vtk/commands/scan, so go up 4 levels to the gem root
94
+ gem_root = File.expand_path('../../../..', __dir__)
95
+ script_path = File.join(gem_root, 'scripts', 'gh-action-trace.sh')
96
+ return [script_path, gem_root] if File.exist?(script_path)
97
+
98
+ [nil, gem_root]
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -70,6 +70,37 @@ module Vtk
70
70
  exit exit_status
71
71
  end
72
72
  end
73
+
74
+ desc 'actions', 'Trace direct and transitive uses of GitHub Actions across an org'
75
+ method_option :help, aliases: '-h', type: :boolean,
76
+ desc: 'Display usage information'
77
+ method_option :org, type: :string, required: false,
78
+ desc: 'GitHub org to search (required)'
79
+ method_option :action, type: :array, default: [],
80
+ desc: 'Action to trace; repeat to trace multiple (required)'
81
+ method_option :depth, type: :numeric,
82
+ desc: 'Max recursion depth for shared workflows (default: 2)'
83
+ method_option :format, type: :string,
84
+ desc: 'Output format: text, json, csv, both (default: both)'
85
+ method_option :external, type: :boolean,
86
+ desc: 'Also search all of GitHub for external shared workflows (slower)'
87
+ method_option :output, type: :string,
88
+ desc: 'Write report output to file (JSON or CSV depending on --format)'
89
+ method_option :check_runs, type: :string,
90
+ desc: 'Check workflow run history during ISO 8601 window (FROM..TO, TO optional)'
91
+ method_option :quiet, aliases: '-q', type: :boolean,
92
+ desc: 'Suppress progress output'
93
+ method_option :verbose, aliases: '-v', type: :boolean,
94
+ desc: 'Show detailed debug info'
95
+ def actions
96
+ if options[:help]
97
+ invoke :help, ['actions']
98
+ else
99
+ require_relative 'scan/actions'
100
+ exit_status = Vtk::Commands::Scan::Actions.new(options).execute
101
+ exit exit_status
102
+ end
103
+ end
73
104
  end
74
105
  end
75
106
  end
@@ -490,7 +490,7 @@ module Vtk
490
490
  end
491
491
 
492
492
  def wsl?
493
- @wsl ||= File.exist?('/proc/version') && File.open('/proc/version').grep(/Microsoft/i).any?
493
+ @wsl ||= File.exist?('/proc/version') && File.foreach('/proc/version').grep(/Microsoft/i).any?
494
494
  end
495
495
 
496
496
  def ubuntu_like?
data/lib/vtk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vtk
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  end