kettle-gha-pins 0.3.17 → 0.3.19

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: ffe68aef091099d6184b26bad561489fd21a3d2b6e6f2effa72d9d26f7df78b0
4
- data.tar.gz: bc873062e96c924d5a5d2310288c01fc858b9398525d8cf33f0bd60d9e04b37a
3
+ metadata.gz: c38d84aa5916b494617f50b181b8e582cf7dc0b656491b132a52c6358f657c8f
4
+ data.tar.gz: ec3a9603687dc389313d6fd17898d7ac88e91efb553b4926dbdc22d86e94fdce
5
5
  SHA512:
6
- metadata.gz: f7f98a2502397076a0106759b9154a3ee9322d7234540dd0bf5cdaa68d95e9df924ceb136dfa26a222d2d0a3f1980e2d15f5b2e14db8297ce5257f526ec0b81b
7
- data.tar.gz: 2c0493614edd7b333bea572f835622f77e12bc3bf2b0387c0f67c92109b374db7ca090ae4688d5d2812fbe342879e2899cde752f53e7ed78b6e7511ad44dc91d
6
+ metadata.gz: 6cde479667aff09d4ce0e032a41dcc16602a722ef031b1208e48e937dbcca520ca7aa64486456fbd9e35fad133282ad18b9400cfeaabe104b16a56309b792930
7
+ data.tar.gz: 33b896ec5e450ec732b1117e2688c9ce110bea1479cdaa4d260ead0b93b95a2c54cd633796c752128dae9145a4069cb2ccd056b72f4289a91f1b159a17df8eb6
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,44 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.3.19] - 2026-10-25
34
+
35
+ - TAG: [v0.3.19][0.3.19t]
36
+ - COVERAGE: 95.16% -- 1081/1136 lines in 8 files
37
+ - BRANCH COVERAGE: 83.65% -- 435/520 branches in 8 files
38
+ - 25.89% documented
39
+
40
+ ### Changed
41
+
42
+ - [kc] ndjson-producer-stream: Emit kettle-gha-pins events through kettle-ndjson with the family-consumed type names and fields. Reject --events with --json to keep stdout a single unambiguous output format.
43
+
44
+ - [kc] kettle-jem/prepare: updated 21 project files:
45
+ - dependencies (21)
46
+ - [kc] kettle-jem/template: updated 13 project files:
47
+ - code and tests (1)
48
+ - dependencies (2)
49
+ - documentation (1)
50
+ - other (2)
51
+ - workflows (7)
52
+
53
+ ## [0.3.18] - 2026-10-15
54
+
55
+ - TAG: [v0.3.18][0.3.18t]
56
+ - COVERAGE: 94.96% -- 1073/1130 lines in 8 files
57
+ - BRANCH COVERAGE: 83.53% -- 431/516 branches in 8 files
58
+ - 26.13% documented
59
+
60
+ ### Changed
61
+
62
+ - [kc] kettle-jem/prepare: updated 8 project files:
63
+ - configuration (1)
64
+ - dependencies (7)
65
+
66
+ - [kc] kettle-jem/template: updated 31 project files:
67
+ - documentation (1)
68
+ - other (1)
69
+ - workflows (29)
70
+
33
71
  ## [0.3.17] - 2026-10-10
34
72
 
35
73
  - TAG: [v0.3.17][0.3.17t]
@@ -416,7 +454,11 @@ Please file a bug if you notice a violation of semantic versioning.
416
454
  - kettle-jem-template-20260720-005 - Generated README Support & Community rows
417
455
  now include a RubyForum help badge.
418
456
 
419
- [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.17...HEAD
457
+ [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.19...HEAD
458
+ [0.3.19]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.18...v0.3.19
459
+ [0.3.19t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.19
460
+ [0.3.18]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.17...v0.3.18
461
+ [0.3.18t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.18
420
462
  [0.3.17]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.16...v0.3.17
421
463
  [0.3.17t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.17
422
464
  [0.3.16]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.15...v0.3.16
data/README.md CHANGED
@@ -43,7 +43,7 @@ kettle-gha-pins --write --upgrade major
43
43
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
44
44
  |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
45
45
  | Works with JRuby | [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎jruby-9.2-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎jruby-9.3-wf] <br/> [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎jruby-9.4-wf] [![JRuby 10.0 Compat][💎jruby-10.0i]][🚎jruby-10.0-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
46
- | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎truby-23.0-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf]|
46
+ | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
47
47
  | Works with MRI Ruby 4 | [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
48
48
  | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
49
49
  | Works with MRI Ruby 2 | [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
@@ -59,6 +59,7 @@ kettle-gha-pins --write --upgrade major
59
59
 
60
60
  Compatible with MRI Ruby 2.4.0+, JRuby, and TruffleRuby.
61
61
  CI workflows and Appraisals are generated for MRI Ruby 2.4.0+.
62
+ The current MRI CI lane runs on Linux and macOS.
62
63
  This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
63
64
  may be higher than the gem's runtime compatibility floor when legacy Rubies are
64
65
  not practical for the current toolchain.
@@ -98,29 +99,12 @@ The _amazing_ test matrix is powered by the kettle-dev stack.
98
99
 
99
100
  ### Enterprise Support
100
101
 
101
- [![Tidelift](https://tidelift.com/badges/package/rubygems/kettle-gha-pins)](https://tidelift.com/subscription/pkg/rubygems-kettle-gha-pins?utm_source=rubygems-kettle-gha-pins&utm_medium=referral&utm_campaign=readme)
102
+ For enterprise support from the maintainer, use [Upwork][👨🏼‍🏫expsup-upwork] or [CodeMentor][👨🏼‍🏫expsup-codementor].
102
103
 
103
- Available as part of the Tidelift Subscription.
104
-
105
- <details markdown="1">
106
- <summary>Need enterprise-level guarantees?</summary>
107
-
108
- The maintainers of this and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
109
-
110
- [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]
111
-
112
- - 💡Subscribe for support guarantees covering _all_ your FLOSS dependencies
113
- - 💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]
114
- - 💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers
115
-
116
- Alternatively:
104
+ Other support channels:
117
105
 
118
106
  - [![Ruby Users Forum][✉️ruby-forum-img]][✉️ruby-forum]
119
107
  - [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
120
- - [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork]
121
- - [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor]
122
-
123
- </details>
124
108
 
125
109
  ## ✨ Installation
126
110
 
@@ -224,19 +208,18 @@ We welcome both individual and corporate sponsors! We also offer a
224
208
  wide array of funding channels to account for your preferences.
225
209
  Currently, [Open Collective][🖇osc] is our preferred funding platform.
226
210
 
211
+ ### Corporate Sponsorship
212
+
227
213
  **If you're working in a company that's making significant use of kettle-dev tools we'd
228
214
  appreciate it if you suggest to your company to become a kettle-dev sponsor.**
229
215
 
216
+ ### Individual Support
217
+
230
218
  You can support the development of kettle-dev tools via
231
219
  [GitHub Sponsors][🖇sponsor],
232
220
  [Liberapay][⛳liberapay],
233
- [PayPal][🖇paypal],
234
- [Open Collective][🖇osc]
235
- and [Tidelift][🏙️entsup-tidelift].
236
-
237
- | 📍 NOTE |
238
- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
239
- | If doing a sponsorship in the form of donation is problematic for your company <br/> from an accounting standpoint, we'd recommend the use of Tidelift, <br/> where you can get a support-like subscription instead. |
221
+ [Open Collective][🖇osc],
222
+ and [PayPal][🖇paypal].
240
223
 
241
224
  ### Open Collective for Individuals
242
225
 
@@ -451,9 +434,6 @@ Thanks for RTFM. ☺️
451
434
  [👨🏼‍🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
452
435
  [👨🏼‍🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
453
436
  [👨🏼‍🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-Get_Help-1abc9c?style=for-the-badge&logo=CodeMentor&logoColor=white
454
- [🏙️entsup-tidelift]: https://tidelift.com/subscription/pkg/rubygems-kettle-gha-pins?utm_source=rubygems-kettle-gha-pins&utm_medium=referral&utm_campaign=readme
455
- [🏙️entsup-tidelift-img]: https://img.shields.io/badge/Tidelift_and_Sonar-Enterprise_Support-FD3456?style=for-the-badge&logo=sonar&logoColor=white
456
- [🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
457
437
  [💁🏼‍♂️peterboling]: http://www.peterboling.com
458
438
  [🚂railsbling]: http://www.railsbling.com
459
439
  [📜src-gl-img]: https://img.shields.io/badge/GitLab-FBA326?style=for-the-badge&logo=Gitlab&logoColor=orange
@@ -494,7 +474,6 @@ Thanks for RTFM. ☺️
494
474
  [🚎jruby-9.4-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/jruby-9.4.yml
495
475
  [🚎jruby-10.0-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/jruby-10.0.yml
496
476
  [🚎truby-22.3-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/truffleruby-22.3.yml
497
- [🚎truby-23.0-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/truffleruby-23.0.yml
498
477
  [🚎truby-23.1-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/truffleruby-23.1.yml
499
478
  [🚎truby-24.2-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/truffleruby-24.2.yml
500
479
  [🚎truby-25.0-wf]: https://github.com/kettle-dev/kettle-gha-pins/actions/workflows/truffleruby-25.0.yml
@@ -531,13 +510,11 @@ Thanks for RTFM. ☺️
531
510
  [💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
532
511
  [💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
533
512
  [💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
534
- [💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
535
513
  [💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
536
514
  [💎truby-24.2i]: https://img.shields.io/badge/Truffle_Ruby-24.2-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
537
515
  [💎truby-25.0i]: https://img.shields.io/badge/Truffle_Ruby-25.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
538
516
  [💎truby-33.0i]: https://img.shields.io/badge/Truffle_Ruby-33.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
539
517
  [💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
540
- [💎truby-headi]: https://img.shields.io/badge/Truffle_Ruby-HEAD-34BCB1?style=for-the-badge&logo=ruby&logoColor=blue
541
518
  [💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
542
519
  [💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
543
520
  [💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
@@ -570,7 +547,7 @@ Thanks for RTFM. ☺️
570
547
  [📌gitmoji]: https://gitmoji.dev
571
548
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
572
549
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
573
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.100-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
550
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.136-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
574
551
  [🔐security]: https://github.com/kettle-dev/kettle-gha-pins/blob/main/SECURITY.md
575
552
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
576
553
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -600,5 +577,5 @@ Thanks for RTFM. ☺️
600
577
  | Homepage | https://github.com/kettle-dev/kettle-gha-pins |
601
578
  | Source | https://github.com/kettle-dev/kettle-gha-pins |
602
579
  | License | `MIT` |
603
- | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/kettle-gha-pins, https://www.buymeacoffee.com/pboling |
580
+ | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://www.buymeacoffee.com/pboling |
604
581
  <!-- kettle-jem:metadata:end -->
@@ -9,6 +9,7 @@ require "time"
9
9
 
10
10
  require "psych"
11
11
  require "ruby-progressbar"
12
+ require "kettle/ndjson"
12
13
  require "kettle/gha/pins"
13
14
  require_relative "cache_progress"
14
15
 
@@ -36,6 +37,7 @@ module Kettle
36
37
  GitHubClient = Kettle::Gha::Pins::GitHubClient
37
38
  VERSION_COMMENT_SUFFIX_RE = /\A\s+#\s*v?(?<version>\d+(?:\.\d+){0,2}(?:[-.]?[0-9A-Za-z.-]+)?)/
38
39
  VERSION_COMMENT_REPLACEMENT_RE = /\A(?<prefix>\s+#\s*)v?\d+(?:\.\d+){0,2}(?:[-.]?[0-9A-Za-z.-]+)?/
40
+ EVENT_TYPES = %w[gha_sha_pins_start gha_sha_pins_workflows gha_sha_pins_action gha_sha_pins_summary].freeze
39
41
 
40
42
  def self.release_version_sort_key(entry)
41
43
  Kettle::Gha::Pins::VersionRubric.sort_key(entry)
@@ -62,6 +64,8 @@ module Kettle
62
64
  events: false,
63
65
  validate: true,
64
66
  write: false,
67
+ commit: false,
68
+ push: false,
65
69
  check: false,
66
70
  api_base: API_BASE,
67
71
  user_agent: "kettle-gha-pins",
@@ -75,12 +79,20 @@ module Kettle
75
79
  mode: :project,
76
80
  input: nil,
77
81
  reject_patterns: Set.new,
78
- progress: nil
82
+ progress: nil,
83
+ event_stream: nil
79
84
  }
80
85
  end
81
86
 
82
87
  def run!
83
88
  parse!
89
+ if @options[:events]
90
+ @options[:event_stream] = Kettle::Ndjson.event_stream(
91
+ $stdout,
92
+ types: EVENT_TYPES.join(","),
93
+ event_types: EVENT_TYPES
94
+ )
95
+ end
84
96
 
85
97
  return list_workflows! if @options[:mode] == :list
86
98
 
@@ -302,6 +314,7 @@ module Kettle
302
314
  end
303
315
  end
304
316
  action_progress.stop
317
+ commit_written_pins! if @options[:commit] && state[:changed_files].any?
305
318
  progress_message("Action resolution checks: #{action_progress.cached_count} cached, #{action_progress.live_count} live.") if action_count.positive?
306
319
  emit_event(
307
320
  "summary",
@@ -406,6 +419,17 @@ module Kettle
406
419
  @options[:write] = true
407
420
  @options[:dry_run] = false
408
421
  end
422
+ opt.on("--commit", "Commit written workflow files (implies --write; no-op without changes)") do
423
+ @options[:write] = true
424
+ @options[:dry_run] = false
425
+ @options[:commit] = true
426
+ end
427
+ opt.on("--push", "Push the commit created by --commit (requires --commit)") do
428
+ @options[:commit] = true
429
+ @options[:write] = true
430
+ @options[:dry_run] = false
431
+ @options[:push] = true
432
+ end
409
433
  opt.on("--check", "Fail when workflow action pins are stale or mutable") do
410
434
  @options[:check] = true
411
435
  end
@@ -454,7 +478,7 @@ module Kettle
454
478
  opt.on("--json", "Emit JSON report") do
455
479
  @options[:json] = true
456
480
  end
457
- opt.on("--events", "Emit line-delimited JSON events") do
481
+ opt.on("--events", "Emit kettle-ndjson event stream to stdout; write the human report to stderr") do
458
482
  @options[:events] = true
459
483
  end
460
484
  opt.on("--[no-]progress", "Show progress feedback on STDERR (default: on unless --json)") do |bool|
@@ -476,6 +500,9 @@ module Kettle
476
500
  end
477
501
  end
478
502
  parser.parse!(@argv)
503
+ if @options[:events] && @options[:json]
504
+ raise Error, "--events cannot be combined with --json"
505
+ end
479
506
  if @options[:mode] == :review && @options[:offline]
480
507
  raise OptionParser::InvalidOption, "--review cannot be combined with --offline"
481
508
  end
@@ -540,7 +567,11 @@ module Kettle
540
567
  def emit_event(action, payload = {})
541
568
  return unless @options[:events]
542
569
 
543
- puts JSON.generate({"event_version" => 1, "type" => "gha_sha_pins_#{action}", "action" => action}.merge(payload))
570
+ Kettle::Ndjson.emit_event(
571
+ @options.fetch(:event_stream),
572
+ "gha_sha_pins_#{action}",
573
+ payload.merge(action: action)
574
+ )
544
575
  end
545
576
 
546
577
  def progress_message(message)
@@ -859,6 +890,44 @@ module Kettle
859
890
  }
860
891
  end
861
892
 
893
+ # Commit (and optionally push) the workflow files written by this run.
894
+ # Scoped to .github/workflows so unrelated dirty files are never
895
+ # swept into the pin commit. No-op when nothing changed.
896
+ def commit_written_pins!
897
+ commit_message = "🔒️ Pin GitHub Actions SHAs"
898
+ # @options[:root] may be anywhere (often ".github/workflows" under
899
+ # the process cwd); anchor every git invocation at the containing
900
+ # repository worktree rather than guessing from the scan path.
901
+ git_dir, stderr, status = Open3.capture3("git", "-C", @options[:root], "rev-parse", "--show-toplevel")
902
+ unless status.success?
903
+ progress_message("Could not locate git repository for pin commit: #{stderr.strip}")
904
+ return
905
+ end
906
+ project_root = git_dir.strip
907
+ stdout, stderr, status = Open3.capture3(
908
+ "git", "-C", project_root, "add", "--", ".github/workflows"
909
+ )
910
+ unless status.success?
911
+ progress_message("Could not stage updated workflow files: #{(stdout + stderr).strip}")
912
+ return
913
+ end
914
+
915
+ stdout, stderr, status = Open3.capture3("git", "-C", project_root, "commit", "-m", commit_message)
916
+ unless status.success?
917
+ # Nothing to commit (race with another writer) is benign; anything
918
+ # else is reported but does not flip the exit code — the pin files
919
+ # themselves were written successfully.
920
+ progress_message("Could not commit updated workflow files: #{(stdout + stderr).strip}") unless stderr.match?(/nothing to commit|no changes added/i)
921
+ return
922
+ end
923
+ progress_message("Committed updated workflow files: #{commit_message}")
924
+
925
+ return unless @options[:push]
926
+
927
+ stdout, stderr, status = Open3.capture3("git", "-C", project_root, "push")
928
+ progress_message(status.success? ? "Pushed pin commit." : "Could not push pin commit: #{(stdout + stderr).strip}")
929
+ end
930
+
862
931
  def locate_scalar_token(line_text, col, old_token)
863
932
  return nil if col.nil? || col.negative? || col >= line_text.length
864
933
 
@@ -1012,7 +1081,8 @@ module Kettle
1012
1081
  end
1013
1082
  if @options[:check] && state[:planned_changes].any?
1014
1083
  lines << ""
1015
- lines << "Recommended fix: kettle-gha-pins --write --upgrade #{@options[:upgrade]}"
1084
+ lines << "Recommended fix: kettle-gha-pins --commit --push --upgrade #{@options[:upgrade]}"
1085
+ lines << "Only afterwards re-run the release resume command printed by kettle-family."
1016
1086
  end
1017
1087
 
1018
1088
  output = lines.join("\n")
@@ -6,7 +6,7 @@ module Kettle
6
6
  # Version namespace for this gem.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "0.3.17"
9
+ VERSION = "0.3.19"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-gha-pins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -37,6 +37,26 @@ cert_chain:
37
37
  -----END CERTIFICATE-----
38
38
  date: 1980-01-02 00:00:00.000000000 Z
39
39
  dependencies:
40
+ - !ruby/object:Gem::Dependency
41
+ name: kettle-ndjson
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.1'
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 0.1.20
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '0.1'
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.1.20
40
60
  - !ruby/object:Gem::Dependency
41
61
  name: ruby-progressbar
42
62
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +94,7 @@ dependencies:
74
94
  version: '1.1'
75
95
  - - ">="
76
96
  - !ruby/object:Gem::Version
77
- version: 1.1.15
97
+ version: 1.1.16
78
98
  type: :runtime
79
99
  prerelease: false
80
100
  version_requirements: !ruby/object:Gem::Requirement
@@ -84,7 +104,7 @@ dependencies:
84
104
  version: '1.1'
85
105
  - - ">="
86
106
  - !ruby/object:Gem::Version
87
- version: 1.1.15
107
+ version: 1.1.16
88
108
  - !ruby/object:Gem::Dependency
89
109
  name: kettle-dev
90
110
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +114,7 @@ dependencies:
94
114
  version: '3.1'
95
115
  - - ">="
96
116
  - !ruby/object:Gem::Version
97
- version: 3.1.8
117
+ version: 3.1.24
98
118
  type: :development
99
119
  prerelease: false
100
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -104,7 +124,7 @@ dependencies:
104
124
  version: '3.1'
105
125
  - - ">="
106
126
  - !ruby/object:Gem::Version
107
- version: 3.1.8
127
+ version: 3.1.24
108
128
  - !ruby/object:Gem::Dependency
109
129
  name: bundler-audit
110
130
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +182,7 @@ dependencies:
162
182
  version: '0.1'
163
183
  - - ">="
164
184
  - !ruby/object:Gem::Version
165
- version: 0.1.3
185
+ version: 0.1.4
166
186
  type: :development
167
187
  prerelease: false
168
188
  version_requirements: !ruby/object:Gem::Requirement
@@ -172,7 +192,7 @@ dependencies:
172
192
  version: '0.1'
173
193
  - - ">="
174
194
  - !ruby/object:Gem::Version
175
- version: 0.1.3
195
+ version: 0.1.4
176
196
  - !ruby/object:Gem::Dependency
177
197
  name: appraisal2
178
198
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +202,7 @@ dependencies:
182
202
  version: '3.2'
183
203
  - - ">="
184
204
  - !ruby/object:Gem::Version
185
- version: 3.2.5
205
+ version: 3.2.6
186
206
  type: :development
187
207
  prerelease: false
188
208
  version_requirements: !ruby/object:Gem::Requirement
@@ -192,7 +212,7 @@ dependencies:
192
212
  version: '3.2'
193
213
  - - ">="
194
214
  - !ruby/object:Gem::Version
195
- version: 3.2.5
215
+ version: 3.2.6
196
216
  - !ruby/object:Gem::Dependency
197
217
  name: kettle-test
198
218
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +222,7 @@ dependencies:
202
222
  version: '2.0'
203
223
  - - ">="
204
224
  - !ruby/object:Gem::Version
205
- version: 2.0.23
225
+ version: 2.0.27
206
226
  type: :development
207
227
  prerelease: false
208
228
  version_requirements: !ruby/object:Gem::Requirement
@@ -212,27 +232,27 @@ dependencies:
212
232
  version: '2.0'
213
233
  - - ">="
214
234
  - !ruby/object:Gem::Version
215
- version: 2.0.23
235
+ version: 2.0.27
216
236
  - !ruby/object:Gem::Dependency
217
237
  name: turbo_tests2
218
238
  requirement: !ruby/object:Gem::Requirement
219
239
  requirements:
220
240
  - - "~>"
221
241
  - !ruby/object:Gem::Version
222
- version: '3.2'
242
+ version: '4.0'
223
243
  - - ">="
224
244
  - !ruby/object:Gem::Version
225
- version: 3.2.14
245
+ version: 4.0.0
226
246
  type: :development
227
247
  prerelease: false
228
248
  version_requirements: !ruby/object:Gem::Requirement
229
249
  requirements:
230
250
  - - "~>"
231
251
  - !ruby/object:Gem::Version
232
- version: '3.2'
252
+ version: '4.0'
233
253
  - - ">="
234
254
  - !ruby/object:Gem::Version
235
- version: 3.2.14
255
+ version: 4.0.0
236
256
  - !ruby/object:Gem::Dependency
237
257
  name: stone_checksums
238
258
  requirement: !ruby/object:Gem::Requirement
@@ -301,10 +321,10 @@ licenses:
301
321
  - MIT
302
322
  metadata:
303
323
  homepage_uri: https://github.com/kettle-dev/kettle-gha-pins
304
- source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.17
305
- changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.17/CHANGELOG.md
324
+ source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.19
325
+ changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.19/CHANGELOG.md
306
326
  bug_tracker_uri: https://github.com/kettle-dev/kettle-gha-pins/issues
307
- documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.17
327
+ documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.19
308
328
  funding_uri: https://github.com/sponsors/pboling
309
329
  wiki_uri: https://github.com/kettle-dev/kettle-gha-pins/wiki
310
330
  news_uri: https://www.railsbling.com/tags/kettle-gha-pins
metadata.gz.sig CHANGED
Binary file