Skip to content

fix: ci release error - #15

Merged
dsun0720 merged 1 commit into
masterfrom
fix-ci-release
Aug 7, 2026
Merged

fix: ci release error#15
dsun0720 merged 1 commit into
masterfrom
fix-ci-release

Conversation

@dsun0720

@dsun0720 dsun0720 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Improved the automated release process.
    • Release publishing now uses the project’s version and release notes more reliably.
    • Updated the release workflow to use current tooling and secure repository permissions.

Greptile Summary

The PR modernizes the release workflow and replaces third-party release helpers with inline Python and the GitHub CLI.

  • Upgrades actions/checkout from v3 to v4.
  • Grants the job contents:write and uses github.token to create releases.
  • Reads the package version with Python and passes release notes through gh release create.

Confidence Score: 3/5

This PR should not merge until the version is passed to the shell through a safe data boundary or strictly validated before release creation.

The changed workflow expands unvalidated repository metadata into shell source while exposing a contents:write token, making shell command execution reachable from a malicious version value.

Files Needing Attention: .github/workflows/release.yaml

Security Review

The version read from repository metadata is directly expanded into shell source in a write-capable job, allowing shell syntax in that value to execute with repository credentials. How this was verified: The push-triggered workflow copies the unvalidated JSON value into a step output and expands it directly on the gh command line while GH_TOKEN has contents:write.

Important Files Changed

Filename Overview
.github/workflows/release.yaml Reworks release creation around gh and github.token, but directly interpolates the repository-controlled version into a privileged shell script.
Prompt To Fix All With AI
### Issue 1
.github/workflows/release.yaml:34-40
**Version output enables shell injection**

When a commit on `master` or `main` supplies shell syntax in `release/package.json`, GitHub expands the unvalidated version directly into this script before parsing, allowing arbitrary commands to run with the `contents: write` token and modify repository content. Pass the output through an environment variable so the shell treats it as data. **How this was verified:** The workflow copies the unvalidated JSON value into a step output and expands it directly into a command executed with `GH_TOKEN` and `contents: write`.

```suggestion
      - name: Create GitHub Release
        env:
          GH_TOKEN: ${{ github.token }}
          VERSION: ${{ steps.version.outputs.value }}
        run: |
          gh release create "v${VERSION}" \
            --title "v${VERSION}" \
            --notes-file release/description.md
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: ci release error" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@dsun0720
dsun0720 merged commit 9a05180 into master Aug 7, 2026
1 of 9 checks passed
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f12d559b-d525-49db-bcb4-cbff336e1848

📥 Commits

Reviewing files that changed from the base of the PR and between 2809563 and a873442.

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

📝 Walkthrough

Walkthrough

The release workflow now grants repository content write access, uses actions/checkout@v4, reads the package version with Python, and creates releases with gh release create using GH_TOKEN and release/description.md.

Changes

Release workflow

Layer / File(s) Summary
GitHub release creation
.github/workflows/release.yaml
The deployment job uses repository write permissions, Python version extraction, GH_TOKEN, and gh release create. It removes the previous release actions and token secret configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-ci-release

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.

Comment on lines 34 to +40
- name: Create GitHub Release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_RELEASE_TOKEN }}
with:
tag_name: v${{steps.version.outputs.value}}
release_name: v${{steps.version.outputs.value}}
body: ${{steps.description.outputs.content}}
draft: false
prerelease: false
GH_TOKEN: ${{ github.token }}
run: |
gh release create "v${{ steps.version.outputs.value }}" \
--title "v${{ steps.version.outputs.value }}" \
--notes-file release/description.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Version output enables shell injection

When a commit on master or main supplies shell syntax in release/package.json, GitHub expands the unvalidated version directly into this script before parsing, allowing arbitrary commands to run with the contents: write token and modify repository content. Pass the output through an environment variable so the shell treats it as data. How this was verified: The workflow copies the unvalidated JSON value into a step output and expands it directly into a command executed with GH_TOKEN and contents: write.

Suggested change
- name: Create GitHub Release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_RELEASE_TOKEN }}
with:
tag_name: v${{steps.version.outputs.value}}
release_name: v${{steps.version.outputs.value}}
body: ${{steps.description.outputs.content}}
draft: false
prerelease: false
GH_TOKEN: ${{ github.token }}
run: |
gh release create "v${{ steps.version.outputs.value }}" \
--title "v${{ steps.version.outputs.value }}" \
--notes-file release/description.md
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.value }}
run: |
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--notes-file release/description.md
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yaml
Line: 34-40

Comment:
**Version output enables shell injection**

When a commit on `master` or `main` supplies shell syntax in `release/package.json`, GitHub expands the unvalidated version directly into this script before parsing, allowing arbitrary commands to run with the `contents: write` token and modify repository content. Pass the output through an environment variable so the shell treats it as data. **How this was verified:** The workflow copies the unvalidated JSON value into a step output and expands it directly into a command executed with `GH_TOKEN` and `contents: write`.

```suggestion
      - name: Create GitHub Release
        env:
          GH_TOKEN: ${{ github.token }}
          VERSION: ${{ steps.version.outputs.value }}
        run: |
          gh release create "v${VERSION}" \
            --title "v${VERSION}" \
            --notes-file release/description.md
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant