feat: add action update cooldown#2
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional “update cooldown” feature to prevent upgrading GitHub Action tags that are newer than a specified age, improving supply-chain hygiene by avoiding freshly-published tags.
Changes:
- Introduces
--cooldown-daysCLI flag and threads its value through report planning and GitHub tag resolution. - Enhances GitHub client logic to determine tag “publish time” via git refs (handling annotated vs lightweight tags) and caches tag timestamps.
- Adds tests covering cooldown behavior, unchanged reporting reasons, and CLI parsing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents --cooldown-days usage and how it affects eligibility of tags. |
| internal/github/client.go | Implements cooldown filtering by resolving tag timestamps from GitHub git refs and caching results. |
| internal/github/client_test.go | Adds unit tests for cooldown selection, timestamp source (annotated/lightweight), and caching. |
| cmd/actupdate/main.go | Adds flag parsing and passes cooldown duration into planning/resolution. |
| cmd/actupdate/main_test.go | Adds CLI parsing tests and end-to-end-ish run tests for cooldown scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--cooldown-daysflag to gate upgrades on tag ageTesting
go test ./...Fixes #1
Drive by
.github/workflows/ci.ymlto ensure tests are run on pull requests and pushes tomain.