Visitar URL original
chore(ci): adding release workflow by axel7083 · Pull Request #84 · podman-desktop/extension-grype · GitHub
Skip to content

chore(ci): adding release workflow - #84

Merged
axel7083 merged 1 commit into
podman-desktop:mainfrom
axel7083:chore/ci/release-yaml
Apr 1, 2026
Merged

axel7083 merged 1 commit into
podman-desktop:mainfrom
axel7083:chore/ci/release-yaml

Conversation

@axel7083

Copy link
Copy Markdown
Contributor

Fixes #82

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 changed the title chore(ci): adding release workflow chore(ci): adding release workflow Mar 31, 2026
@axel7083 axel7083 changed the title chore(ci): adding release workflow chore(ci): adding release workflow Mar 31, 2026
@coderabbitai

coderabbitai Bot commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new GitHub Actions workflow was added to facilitate manual releases. The workflow accepts version and branch inputs, manages version updates across package.json files, creates git tags and draft releases, handles next version development preparation when releasing from main, builds and pushes a container image, and publishes the final release.

Changes

Cohort / File(s) Summary
Release Workflow
.github/workflows/release.yaml
New workflow with three jobs: tag (version updates, git tagging, draft release creation, optional next-version PR), build (container image build and push to ghcr.io), and release (draft release publication). Includes conditional logic for main branch releases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description references issue #82, which requests the addition of a release.yaml workflow, directly relating to the changeset.
Linked Issues check ✅ Passed The PR successfully implements the release.yaml workflow requested in issue #82, with comprehensive CI/CD functionality for versioning, building, and publishing releases.
Out of Scope Changes check ✅ Passed All changes are focused on adding the release workflow file, which is directly aligned with the linked issue's objective to provide a release CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'chore(ci): adding release workflow' directly and accurately describes the main change—adding a new release workflow to the CI configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yaml:
- Around line 143-145: The workflow currently always pushes the "latest" tag;
update the tags expression so "latest" is only included when the release branch
is main by gating it on github.event.inputs.branch == 'main'. Concretely, change
the tags block to conditionally include "latest" (e.g. use an expression
referencing github.event.inputs.branch and needs.tag.outputs.extVersion) so
non-main branches push only the version tag (needs.tag.outputs.extVersion) while
main pushes both the version and "latest".
- Around line 110-115: Remove the redundant ready-for-review step by deleting
the gh pr ready invocation and its accompanying echo; specifically, remove the
echo "➡️ Flag the PR as being ready for review" and the gh pr ready
"${pullRequestUrl}" call since the PR created by pullRequestUrl (via gh pr
create) is not a draft by default.
- Around line 62-74: The workflow sets git user.name but not user.email which
causes git commit (and git commit --amend) to fail; add a git config --local
user.email entry using the actor noreply address (e.g. "${{ github.actor
}}@users.noreply.github.com") wherever git config --local user.name is set
before the commit operations so both the commit in the tagging step and the
commit --amend in the bump step succeed; update the blocks around the existing
git config --local user.name and the git commit / git commit --amend commands to
include the corresponding git config --local user.email line.
- Around line 53-58: The current TAG_UTIL step stores the raw
github.event.inputs.version into TAG_PATTERN and writes githubTag=v$TAG_PATTERN
and extVersion=$TAG_PATTERN without validation or quoting, which can cause
double "v" prefixes and allow shell/sed injection when later used in git tag/git
push/git checkout/sed; update the TAG_UTIL logic to (1) normalize the input by
stripping any leading "v" (so a user inputting "v1.2.3" becomes "1.2.3"), (2)
validate the remainder against a strict regex like
/^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$/ and fail the job if it doesn't
match, (3) construct githubTag by prepending a single "v"
(githubTag=v${CLEAN_VERSION}) and set extVersion=${CLEAN_VERSION}, and (4)
ensure downstream uses of githubTag/extVersion in git tag, git push, git
checkout and sed are quoted/parameterized so the sanitized values are not
interpreted by the shell or sed (references: TAG_UTIL, TAG_PATTERN, githubTag,
extVersion, and commands git tag/git push/git checkout/sed).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d2c02ab-0b54-478a-ae7a-0a4aba21a19d

📥 Commits

Reviewing files that changed from the base of the PR and between 6a863ed and 3dd3ade.

📒 Files selected for processing (1)
  • .github/workflows/release.yaml

Comment on lines +53 to +58
- name: Generate tag utilities
id: TAG_UTIL
run: |
TAG_PATTERN=${{ github.event.inputs.version }}
echo "githubTag=v$TAG_PATTERN" >> ${GITHUB_OUTPUT}
echo "extVersion=$TAG_PATTERN" >> ${GITHUB_OUTPUT}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/release.yaml

Repository: podman-desktop/extension-grype

Length of output: 7881


🏁 Script executed:

# Check if repository is public and get basic info
git config --get remote.origin.url
git ls-files | head -5

Repository: podman-desktop/extension-grype

Length of output: 253


Validate and normalize version before using it in commands.

Lines 56–58 accept the manual version input without validation, then pass it unquoted into git tag, git push, git checkout, and sed commands (lines 65–67, 76–77, 99–101, 116). This allows shell injection if the input contains metacharacters like ;, &, backticks, or $(...), and sed injection if the input contains / or other regex special characters.

Additionally, if a user provides input like v1.2.3, the workflow produces tag vv1.2.3 instead of v1.2.3.

🔒 Hardening fix
       - name: Generate tag utilities
         id: TAG_UTIL
+        env:
+          RELEASE_VERSION: ${{ github.event.inputs.version }}
         run: |
-            TAG_PATTERN=${{ github.event.inputs.version }}
-            echo "githubTag=v$TAG_PATTERN" >> ${GITHUB_OUTPUT}
-            echo "extVersion=$TAG_PATTERN" >> ${GITHUB_OUTPUT}
+            TAG_PATTERN="$RELEASE_VERSION"
+            if [[ ! "$TAG_PATTERN" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+              echo "Expected version format <major>.<minor>.<patch>, got: $TAG_PATTERN" >&2
+              exit 1
+            fi
+            {
+              echo "githubTag=v$TAG_PATTERN"
+              echo "extVersion=$TAG_PATTERN"
+            } >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Generate tag utilities
id: TAG_UTIL
run: |
TAG_PATTERN=${{ github.event.inputs.version }}
echo "githubTag=v$TAG_PATTERN" >> ${GITHUB_OUTPUT}
echo "extVersion=$TAG_PATTERN" >> ${GITHUB_OUTPUT}
- name: Generate tag utilities
id: TAG_UTIL
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
run: |
TAG_PATTERN="$RELEASE_VERSION"
if [[ ! "$TAG_PATTERN" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Expected version format <major>.<minor>.<patch>, got: $TAG_PATTERN" >&2
exit 1
fi
{
echo "githubTag=v$TAG_PATTERN"
echo "extVersion=$TAG_PATTERN"
} >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yaml around lines 53 - 58, The current TAG_UTIL
step stores the raw github.event.inputs.version into TAG_PATTERN and writes
githubTag=v$TAG_PATTERN and extVersion=$TAG_PATTERN without validation or
quoting, which can cause double "v" prefixes and allow shell/sed injection when
later used in git tag/git push/git checkout/sed; update the TAG_UTIL logic to
(1) normalize the input by stripping any leading "v" (so a user inputting
"v1.2.3" becomes "1.2.3"), (2) validate the remainder against a strict regex
like /^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$/ and fail the job if it
doesn't match, (3) construct githubTag by prepending a single "v"
(githubTag=v${CLEAN_VERSION}) and set extVersion=${CLEAN_VERSION}, and (4)
ensure downstream uses of githubTag/extVersion in git tag, git push, git
checkout and sed are quoted/parameterized so the sanitized values are not
interpreted by the shell or sed (references: TAG_UTIL, TAG_PATTERN, githubTag,
extVersion, and commands git tag/git push/git checkout/sed).

Comment on lines +62 to +74
git config --local user.name ${{ github.actor }}

# Add the new version in package.json file
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" package.json
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" packages/backend/package.json
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.extVersion }}\",#g" packages/api/package.json

git add package.json
git add packages/backend/package.json
git add packages/api/package.json

# commit the changes
git commit -m "chore: 🥁 tagging ${{ steps.TAG_UTIL.outputs.githubTag }} 🥳"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/release.yaml | sed -n '60,110p'

Repository: podman-desktop/extension-grype

Length of output: 3295


🏁 Script executed:

# Check if there's any email configuration elsewhere in the workflow
rg "user\.email|email" .github/workflows/release.yaml

Repository: podman-desktop/extension-grype

Length of output: 56


🏁 Script executed:

# View the full workflow to check for any earlier setup
head -n 61 .github/workflows/release.yaml

Repository: podman-desktop/extension-grype

Length of output: 1770


🏁 Script executed:

# Check what actions/checkout@v6 does for git config
# Also verify the exact behavior we need to test
web_search "actions/checkout v6 git config user.email"

Repository: podman-desktop/extension-grype

Length of output: 124


🏁 Script executed:

# View the full workflow file
wc -l .github/workflows/release.yaml

Repository: podman-desktop/extension-grype

Length of output: 108


🌐 Web query:

git commit requires user.email configuration in Git

💡 Result:

No, git commit does not strictly require user.email configuration in advance. Git falls back to environment variables (GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL, EMAIL), and if those fail, it attempts to auto-detect from the system username and hostname (e.g., 'user@host.(none)'), but this auto-detection fails with an error if it cannot form a valid email, preventing the commit. If user.name and user.email are unset and no valid fallback is available, attempting git commit produces an error like: * Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" fatal: unable to auto-detect email address (got 'user@host.(none)') To succeed, you must either configure user.email (and user.name), use environment variables, or provide --author (though committer identity still needs resolution). Official git-commit docs confirm Git uses config user.email or fallbacks, but practice shows commits fail without valid identity resolution.

Citations:


🌐 Web query:

GitHub Actions checkout action v6 default git config user.email

💡 Result:

The GitHub Actions checkout action v6 does not set a default git config user.email (or user.name). Users must manually configure these settings if they plan to perform git commits in their workflows. The official README explicitly shows examples where users need to run git config user.name "github-actions[bot]" and git config user.email "41898282+github-actions[bot]@users.noreply.github.com" before committing and pushing, confirming no automatic default is provided by the action. This behavior has persisted across versions, including v6, as no changelog entries or source code changes indicate otherwise. The action primarily handles repository checkout and credential persistence for authentication, but git identity configuration remains a user responsibility.

Citations:


Configure user.email before both commit operations.

Only user.name is configured here. git commit on line 74 and git commit --amend on line 107 will both fail with "fatal: unable to auto-detect email address" without committer email, blocking the release and bump workflows.

Minimal fix
      - name: tag
        run: |
-          git config --local user.name ${{ github.actor }}
+          git config --local user.name "${{ github.actor }}"
+          git config --local user.email "${{ github.actor }}@users.noreply.github.com"

Add the same git config --local user.email "${{ github.actor }}@users.noreply.github.com" line before line 107 in the bump step.

Also applies to: 92-107

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yaml around lines 62 - 74, The workflow sets git
user.name but not user.email which causes git commit (and git commit --amend) to
fail; add a git config --local user.email entry using the actor noreply address
(e.g. "${{ github.actor }}@users.noreply.github.com") wherever git config
--local user.name is set before the commit operations so both the commit in the
tagging step and the commit --amend in the bump step succeed; update the blocks
around the existing git config --local user.name and the git commit / git commit
--amend commands to include the corresponding git config --local user.email
line.

Comment on lines +110 to +115
pullRequestUrl=$(gh pr create --title "chore: 📢 Bump version to ${bumpedVersion}" --body-file /tmp/pr-title --head "${bumpedBranchName}" --base "main")
echo "📢 Pull request created: ${pullRequestUrl}"
echo "➡️ Flag the PR as being ready for review"
gh pr ready "${pullRequestUrl}"
echo "🔅 Mark the PR as being ok to be merged automatically"
gh pr merge "${pullRequestUrl}" --auto --rebase

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

GitHub CLI gh pr create default state draft or ready

💡 Result:

The default state for gh pr create is ready for review (not draft). To create a draft pull request, use the --draft flag. There is no built-in configuration to change the default to draft; a feature request for this was closed as not planned, with aliases suggested as a workaround (e.g., gh alias set draft-pr 'pr create --draft').

Citations:


🏁 Script executed:

# Examine the workflow file to understand context and dependencies
cd .github/workflows && cat -n release.yaml | head -120

Repository: podman-desktop/extension-grype

Length of output: 5881


🌐 Web query:

GitHub CLI gh pr ready behavior already ready pull request error

💡 Result:

When running gh pr ready on a pull request that is already marked as ready for review (not in draft state), the command succeeds without error and prints a message indicating the pull request is already ready, such as "Pull request #960 is already ready for review". It does not produce an error. This behavior has been consistent since the feature was added in 2020 (cli/cli#960), where tests were specifically added for the "already marked" case, and no changes or issues report errors for this scenario in official documentation or recent sources as of 2026.

Citations:


🏁 Script executed:

# Check if there's any error handling or set -e in the workflow
cd .github/workflows && grep -n "set -e\|set -o" release.yaml

Repository: podman-desktop/extension-grype

Length of output: 56


Remove the redundant gh pr ready call.

The PR created on line 110 is already ready-for-review by default (without --draft), making the gh pr ready call on line 113 unnecessary.

Suggested fix
           pullRequestUrl=$(gh pr create --title "chore: 📢 Bump version to ${bumpedVersion}" --body-file /tmp/pr-title --head "${bumpedBranchName}" --base "main")
           echo "📢 Pull request created: ${pullRequestUrl}"
-          echo "➡️ Flag the PR as being ready for review"
-          gh pr ready "${pullRequestUrl}"
           echo "🔅 Mark the PR as being ok to be merged automatically"
           gh pr merge "${pullRequestUrl}" --auto --rebase
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yaml around lines 110 - 115, Remove the redundant
ready-for-review step by deleting the gh pr ready invocation and its
accompanying echo; specifically, remove the echo "➡️ Flag the PR as being ready
for review" and the gh pr ready "${pullRequestUrl}" call since the PR created by
pullRequestUrl (via gh pr create) is not a draft by default.

Comment on lines +143 to +145
tags: |
latest
${{ needs.tag.outputs.extVersion }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Only publish latest from the main release line.

This workflow can release from arbitrary branches, but it always pushes latest. If a maintenance branch ships after a newer mainline release, latest moves backward and image consumers can silently pick up the wrong line. Gate latest behind github.event.inputs.branch == 'main'.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yaml around lines 143 - 145, The workflow
currently always pushes the "latest" tag; update the tags expression so "latest"
is only included when the release branch is main by gating it on
github.event.inputs.branch == 'main'. Concretely, change the tags block to
conditionally include "latest" (e.g. use an expression referencing
github.event.inputs.branch and needs.tag.outputs.extVersion) so non-main
branches push only the version tag (needs.tag.outputs.extVersion) while main
pushes both the version and "latest".

@axel7083
axel7083 merged commit f6be4bb into podman-desktop:main Apr 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(ci): add release.yaml workflow

2 participants