Skip to content

Add release steps to GitHub Actions workflow#1

Merged
XeroHero merged 3 commits intomainfrom
XeroHero-ci-test
Mar 31, 2026
Merged

Add release steps to GitHub Actions workflow#1
XeroHero merged 3 commits intomainfrom
XeroHero-ci-test

Conversation

@XeroHero
Copy link
Copy Markdown
Owner

@XeroHero XeroHero commented Mar 31, 2026

Added steps to publish a GitHub release and use an NPM release action.

Summary by CodeRabbit

  • Chores
    • Added an automated CI workflow that runs on push and pull-request events targeting the main branch.
    • Added automated release/publish steps to streamline deployment and release processes.

Added steps to publish a GitHub release and use an NPM release action.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@XeroHero has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 10 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 10 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e0ba5d1-0119-479e-a9b3-97edd2bdd440

📥 Commits

Reviewing files that changed from the base of the PR and between 7945e6f and 8657f3f.

📒 Files selected for processing (1)
  • .github/workflows/CI.tml
📝 Walkthrough

Walkthrough

A new GitHub Actions workflow .github/workflows/blank.yml was added to run on pushes and pull requests to main; it checks out the repo, runs tobua/release-npm-action@v3.0.2 with tokens, then invokes LogicOverSnacks/actions-publish@v3 targeting xerohero/srctree-linux.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/blank.yml
Added new CI workflow that triggers on push and pull_request to main. Steps: actions/checkout@v4, tobua/release-npm-action@v3.0.2 (uses NPM_TOKEN and ${{ github.token }}), then LogicOverSnacks/actions-publish@v3 with repo: xerohero/srctree-linux.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub (workflow)
    participant Runner as Actions Runner
    participant Checkout as actions/checkout@v4
    participant Release as tobua/release-npm-action@v3.0.2
    participant Publish as LogicOverSnacks/actions-publish@v3
    participant NPM as NPM Registry
    participant Target as xerohero/srctree-linux

    GH->>Runner: trigger on push / pull_request to main
    Runner->>Checkout: checkout repository
    Runner->>Release: run release action (NPM_TOKEN, github.token)
    Release->>NPM: publish package (authenticate with NPM_TOKEN)
    Runner->>Publish: run publish action (repo: xerohero/srctree-linux)
    Publish->>Target: create publish/release in target repo
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into CI, paws light on the key,
Checkout, release, publish — a carrot-stacked spree,
Tokens snug in my pouch, I cheer and I twitch,
One workflow to rule them, one carrot to stitch! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding release steps (NPM release action and publish action) to the GitHub Actions workflow file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/blank.yml (1)

28-28: Avoid hardcoded repository identifier.

Line 28 hardcodes xerohero/srctree-linux. Use ${{ github.repository }} to keep forks/reuse working without edits.

Suggested fix
-          repo:  xerohero/srctree-linux
+          repo: ${{ github.repository }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/blank.yml at line 28, The workflow hardcodes the
repository identifier in the repo field (currently "xerohero/srctree-linux");
replace that hardcoded string with the reusable expression ${{ github.repository
}} so forks and other repos automatically point to the current repository
instead of requiring manual edits—update the repo entry where it currently
contains xerohero/srctree-linux.
🤖 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/blank.yml:
- Around line 17-28: The workflow is missing install/build steps so release
actions may publish incomplete artifacts; add steps that run npm ci and npm run
build (using the repository's scripts.build) before the release actions (i.e.,
before tobua/release-npm-action@v3.0.2 and LogicOverSnacks/actions-publish@v3)
and ensure dist/ (packaged artifacts) exists after the build, optionally adding
a cache step for node_modules to speed CI.
- Around line 6-11: The workflow currently triggers on both push and
pull_request but the release steps run for both; update the release-related
steps (the job/steps using release-npm-action and the "Publish Github Release"
step) to only execute on push events by adding an event guard such as an if:
condition that checks github.event_name == 'push' (or move the guard to the
entire release job) so those release actions do not run for pull_request runs.
- Around line 18-27: The workflow uses mutable action tags (actions/checkout@v4,
tobua/release-npm-action@v3.0.2, LogicOverSnacks/actions-publish@v3); replace
each mutable ref with the corresponding full 40-character commit SHA (keeping
the original tag as a comment, e.g., "# v4") to pin the exact commit for
supply-chain safety, so update the uses lines for actions/checkout,
tobua/release-npm-action, and LogicOverSnacks/actions-publish to their full
commit SHAs after verifying the correct commit in each upstream repo.

---

Nitpick comments:
In @.github/workflows/blank.yml:
- Line 28: The workflow hardcodes the repository identifier in the repo field
(currently "xerohero/srctree-linux"); replace that hardcoded string with the
reusable expression ${{ github.repository }} so forks and other repos
automatically point to the current repository instead of requiring manual
edits—update the repo entry where it currently contains xerohero/srctree-linux.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d47a8f5-70ad-4a12-84d5-ddfad2a18720

📥 Commits

Reviewing files that changed from the base of the PR and between 30b0cc5 and 8e0b3ac.

📒 Files selected for processing (1)
  • .github/workflows/blank.yml

Comment on lines +6 to +11
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find and examine the workflow file
fd -t f "blank.yml" --path ".github/workflows/"

Repository: XeroHero/srctree-linux

Length of output: 299


🏁 Script executed:

# Find the workflow file
fd -t f "blank.yml" .github/workflows/

Repository: XeroHero/srctree-linux

Length of output: 93


🏁 Script executed:

# Read the workflow file with line numbers
cat -n .github/workflows/blank.yml

Repository: XeroHero/srctree-linux

Length of output: 932


Gate release/publish actions to push-only runs.

The workflow triggers on both push and pull_request events (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
       - name: release-npm-action
+        if: github.event_name == 'push'
         uses: tobua/release-npm-action@v3.0.2

       - name: Publish Github Release
+        if: github.event_name == 'push'
         uses: LogicOverSnacks/actions-publish@v3
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/blank.yml around lines 6 - 11, The workflow currently
triggers on both push and pull_request but the release steps run for both;
update the release-related steps (the job/steps using release-npm-action and the
"Publish Github Release" step) to only execute on push events by adding an event
guard such as an if: condition that checks github.event_name == 'push' (or move
the guard to the entire release job) so those release actions do not run for
pull_request runs.

Comment on lines +17 to +28
steps:
- uses: actions/checkout@v4

- name: release-npm-action
uses: tobua/release-npm-action@v3.0.2
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Publish Github Release
uses: LogicOverSnacks/actions-publish@v3
with:
repo: xerohero/srctree-linux
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add install/build steps before release actions.

The workflow never runs npm ci / npm run build. From package.json (scripts.build in Lines 6-13 and packaged dist/**/* in Lines 28-44), release/publish can ship incomplete artifacts or fail when dist/ is missing.

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

‼️ 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
steps:
- uses: actions/checkout@v4
- name: release-npm-action
uses: tobua/release-npm-action@v3.0.2
with:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish Github Release
uses: LogicOverSnacks/actions-publish@v3
with:
repo: xerohero/srctree-linux
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
with:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish Github Release
uses: LogicOverSnacks/actions-publish@v3
with:
repo: xerohero/srctree-linux
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/blank.yml around lines 17 - 28, The workflow is missing
install/build steps so release actions may publish incomplete artifacts; add
steps that run npm ci and npm run build (using the repository's scripts.build)
before the release actions (i.e., before tobua/release-npm-action@v3.0.2 and
LogicOverSnacks/actions-publish@v3) and ensure dist/ (packaged artifacts) exists
after the build, optionally adding a cache step for node_modules to speed CI.

Comment on lines +18 to +27
- uses: actions/checkout@v4

- name: release-npm-action
uses: tobua/release-npm-action@v3.0.2
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Publish Github Release
uses: LogicOverSnacks/actions-publish@v3
with:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find .github -name "blank.yml" -o -name "*.yml" | head -20

Repository: XeroHero/srctree-linux

Length of output: 93


🏁 Script executed:

cat -n .github/workflows/blank.yml

Repository: XeroHero/srctree-linux

Length of output: 932


🌐 Web query:

GitHub Actions pinning commit SHA security best practices 2024 2025

💡 Result:

GitHub Actions: commit-SHA pinning security best practices (2024–2025)

  • Pin every third‑party action to a full‑length commit SHA (40 hex chars), not a floating tag/branch (e.g., @v1, @main). This is GitHub’s recommended way to make an action reference immutable and reduce supply‑chain risk from tag retargeting or repo compromise. [1]

  • Keep the human-readable version as a comment next to the SHA (so reviews can see intent while execution stays immutable), e.g.:

    - uses: actions/checkout@<40-char-sha> # v4.2.2

    (The core point—pin to SHA for immutability—is explicitly recommended by GitHub. [1])

  • Continuously update pinned SHAs (treat them like dependencies). Pinning prevents silent updates; you must explicitly bump SHAs during maintenance (commonly via dependency tooling / PR checks). [1]

  • Enforce SHA pinning with governance controls (org/repo policy). GitHub added/enhanced policy support to help enforce SHA pinning (and also explicitly block actions/workflows) so you can mandate pinning rather than rely on convention. [2]

  • Use automated checks to prevent regressions. Add CI that fails PRs when a workflow uses non‑pinned actions (example: “Ensure SHA Pinned Actions”). [3]

  • Remember “pinned” isn’t always fully immutable in practice. Some actions can still change behavior via externally referenced components (e.g., downloaded binaries/images) even if the repo ref is pinned—so prefer actions that provide truly immutable release artifacts and review what the action executes. [4]

Sources

[1] GitHub Docs — Security hardening for GitHub Actions (section: “Pin actions to a full length commit SHA”).
[2] GitHub Changelog (2025‑08‑15) — Actions policy now supports blocking and SHA pinning actions.
[3] GitHub Marketplace — Ensure SHA Pinned Actions.
[4] GitHub Well‑Architected — Securing GitHub Actions Workflows (recommendation to pin to immutable refs; notes on residual mutability).


Pin third-party GitHub Actions to commit SHAs.

Lines 18, 21, and 26 use mutable tags (actions/checkout@v4, tobua/release-npm-action@v3.0.2, LogicOverSnacks/actions-publish@v3). For supply-chain safety, pin each to a full-length commit SHA with the version as a comment (e.g., actions/checkout@<40-char-sha> # v4). This prevents tag retargeting and repo compromise risks.

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
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/blank.yml around lines 18 - 27, The workflow uses mutable
action tags (actions/checkout@v4, tobua/release-npm-action@v3.0.2,
LogicOverSnacks/actions-publish@v3); replace each mutable ref with the
corresponding full 40-character commit SHA (keeping the original tag as a
comment, e.g., "# v4") to pin the exact commit for supply-chain safety, so
update the uses lines for actions/checkout, tobua/release-npm-action, and
LogicOverSnacks/actions-publish to their full commit SHAs after verifying the
correct commit in each upstream repo.

Added NPM_TOKEN to release-npm-action step.
@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Mar 31, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29399951 Triggered npm Token 7945e6f .github/workflows/blank.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/blank.yml:
- Around line 20-24: The workflow currently hardcodes an NPM token in the
release-npm-action block (the NPM_TOKEN input value), which must be removed and
rotated: immediately revoke the exposed token on npmjs, create a new token and
save it as a GitHub Actions secret (e.g., NPM_TOKEN), then update the workflow
step that uses tobua/release-npm-action@v3.0.2 to remove the plaintext token and
reference the secret via ${{ secrets.NPM_TOKEN }} instead of the hardcoded
value; commit only the workflow change and avoid reintroducing secrets into
history (rotate the token and consider rewriting history if necessary).
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ea43a80-5a04-4d08-b1ec-3c3aea9a4be1

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0b3ac and 7945e6f.

📒 Files selected for processing (1)
  • .github/workflows/blank.yml

@XeroHero
Copy link
Copy Markdown
Owner Author

/merge

@XeroHero XeroHero self-assigned this Mar 31, 2026
@XeroHero XeroHero added the enhancement New feature or request label Mar 31, 2026
@XeroHero XeroHero added this to the CI/CD milestone Mar 31, 2026
@XeroHero XeroHero merged commit e908480 into main Mar 31, 2026
1 check passed
@XeroHero XeroHero deleted the XeroHero-ci-test branch March 31, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant