-
Notifications
You must be signed in to change notification settings - Fork 0
Add release steps to GitHub Actions workflow #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This is a basic workflow to help you get started with Actions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Controls when the workflow will run | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Triggers the workflow on push or pull request events but only for the "main" branch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [ "main" ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [ "main" ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: release-npm-action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: tobua/release-npm-action@v3.0.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GITHUB_TOKEN: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Publish Github Release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: LogicOverSnacks/actions-publish@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find .github -name "blank.yml" -o -name "*.yml" | head -20Repository: XeroHero/srctree-linux Length of output: 93 🏁 Script executed: cat -n .github/workflows/blank.ymlRepository: XeroHero/srctree-linux Length of output: 932 🌐 Web query:
💡 Result: GitHub Actions: commit-SHA pinning security best practices (2024–2025)
Sources[1] GitHub Docs — Security hardening for GitHub Actions (section: “Pin actions to a full length commit SHA”). Pin third-party GitHub Actions to commit SHAs. Lines 18, 21, and 26 use mutable tags ( Suggested fix- - uses: actions/checkout@v4
+ - uses: actions/checkout@<40-char-sha> # v4
@@
- uses: tobua/release-npm-action@v3.0.2
+ uses: tobua/release-npm-action@<40-char-sha> # v3.0.2
@@
- uses: LogicOverSnacks/actions-publish@v3
+ uses: LogicOverSnacks/actions-publish@<40-char-sha> # v3🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo: xerohero/srctree-linux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add install/build steps before release actions. The workflow never runs Suggested fix steps:
- uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ - name: Install dependencies
+ run: npm ci
+ - name: Build artifacts
+ run: npm run build
- name: release-npm-action
uses: tobua/release-npm-action@v3.0.2📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: XeroHero/srctree-linux
Length of output: 299
🏁 Script executed:
Repository: XeroHero/srctree-linux
Length of output: 93
🏁 Script executed:
# Read the workflow file with line numbers cat -n .github/workflows/blank.ymlRepository: XeroHero/srctree-linux
Length of output: 932
Gate release/publish actions to push-only runs.
The workflow triggers on both
pushandpull_requestevents (lines 8-11), but the release-npm-action (line 20-23) and Publish Github Release (line 25-28) steps execute regardless of event type. This mixes validation and release responsibilities; PR events lack the necessary permissions and context for releases, causing failed runs and unintended publish attempts.Add conditional guards to gate release actions to push events only:
Suggested fix
🤖 Prompt for AI Agents