-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Don't tag latest
when not latest version
#38296
base: release
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces a significant refactoring of the GitHub Actions release workflow, focusing on improving the Docker image tagging and version handling process. A new JavaScript module Changes
Sequence DiagramsequenceDiagram
participant GA as GitHub Actions
participant Prelude as prelude.js
participant Core as GitHub Core
GA->>Prelude: Invoke with context
Prelude->>Prelude: Validate tag format
Prelude->>Core: Set tag output
Prelude->>Prelude: Generate Docker tags
Prelude->>Core: Set docker_tags output
Prelude-->>GA: Return workflow outputs
Possibly Related PRs
Suggested Reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/scripts/github-release/prelude.js (3)
1-2
: Consider using execFile for better security.
Although the current approach is fine for quick commands, you can reduce potential security concerns by switching to execFile.
20-26
: Check error handling on getLatestTag() calls.
If getLatestTag() fails unexpectedly, consider a short descriptive message for troubleshooting.
39-53
: Ensure robust error reporting in getLatestTag.
If tagged versions are missing, consider a fallback or message for clarity instead of resolving an empty string.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/github-release.yml
(3 hunks).github/workflows/scripts/github-release/prelude.js
(1 hunks)
🔇 Additional comments (9)
.github/workflows/scripts/github-release/prelude.js (6)
3-10
: Module exports block looks good.
The summary entries help keep logs concise. No issues here.
11-14
: Impressive validation for tag format.
This ensures an early exit for invalid tags. Great job.
16-19
: Output naming is clear.
The code ensures the version is exposed via outputs for downstream tasks.
28-30
: Minimal overhead for pushing 'latest' tag.
Conditionally adding the latest tag is a neat approach.
32-35
: Good UI feedback via summary.
Printing docker tags helps debugging and clarity.
36-37
: Immediate summary write is helpful.
Ensures logs are flushed. All set.
.github/workflows/github-release.yml (3)
Line range hint 1-21
: Logical workflow structure.
Renaming the workflow to "Github Release" clarifies its purpose.
24-40
: Steps readability is good.
The usage of actions/github-script@v7 to run your new JavaScript module is straightforward.
279-279
: Multiple tags assignment.
Replacing the old single tag approach with your new Docker tags output is a robust solution.
When we're tagging a version that's not the latest version, then don't update the
latest
Docker image on Docker hub. Like, if the current latest isv1.20
, and we publish the hotfix tagv1.18.1
to fix a critical bug inv1.18
, then we only want to publish the Docker image at the tagv1.18.1
, and not updatelatest
. We wantlatest
to continue to point tov1.20
.Tested on a separate private repo, confirmed working.
Communication
Should the DevRel and Marketing teams inform users about this change?
Warning
Tests have not run on the HEAD 21b3f9f yet
Sat, 21 Dec 2024 05:33:37 UTC
Summary by CodeRabbit
New Features
Bug Fixes
Documentation