Skip to content

chore: enforce semantic pr#13

Closed
smnatale wants to merge 2 commits into
mainfrom
chore/semantic-pr
Closed

chore: enforce semantic pr#13
smnatale wants to merge 2 commits into
mainfrom
chore/semantic-pr

Conversation

@smnatale
Copy link
Copy Markdown
Owner

@smnatale smnatale commented Apr 14, 2026

Description

add gh workflow enforcing semantic pr

Screenshots/Images

Summary by CodeRabbit

  • Chores
    • Added automated pull request validation to enforce consistent naming conventions for contributions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@smnatale has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 35 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 57 minutes and 35 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6189c7c6-5164-43c1-9373-f0850b316c09

📥 Commits

Reviewing files that changed from the base of the PR and between c0c5cd5 and 62f740a.

📒 Files selected for processing (2)
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/workflows/semantic-pr.yml
📝 Walkthrough

Walkthrough

A new GitHub Actions workflow file has been added to enforce semantic versioning conventions on pull requests, using the amannn/action-semantic-pull-request action to validate PR titles and types against configured rules.

Changes

Cohort / File(s) Summary
Semantic PR Workflow Configuration
.github/workflows/semantic-pr.yml
Added workflow triggered on pull_request_target events to validate PR title format (lowercase start) and semantic type (feat, fix, chore, docs, test, refactor, ci, perf) with scope requirements disabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 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 pull request title 'chore: enforce semantic pr' directly and clearly describes the main change—adding a GitHub Actions workflow to enforce semantic PR conventions.
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.


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
Contributor

@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

🧹 Nitpick comments (1)
.github/workflows/semantic-pr.yml (1)

5-5: Consider adding reopened to the trigger list.

This keeps semantic-title checks consistent when a closed PR is reopened without further edits.

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

In @.github/workflows/semantic-pr.yml at line 5, Update the GitHub Actions
workflow trigger by adding "reopened" to the types list so the semantic PR check
runs when a previously closed PR is reopened; modify the existing types array
(currently containing "opened", "edited", "synchronize") to include "reopened"
to ensure consistency for the semantic-title check.
🤖 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/semantic-pr.yml:
- Around line 14-16: The workflow currently references the third-party action as
amannn/action-semantic-pull-request@v5 (in the uses: line), which is mutable;
replace the tag with the corresponding immutable commit SHA for the v5 release
(e.g., amannn/action-semantic-pull-request@<commit-sha>) so the action is
pinned, and update the uses: entry accordingly; locate the uses:
amannn/action-semantic-pull-request@v5 string in the workflow and swap the tag
for the commit SHA obtained from the repo (ensure no other references to `@v5`
remain).

---

Nitpick comments:
In @.github/workflows/semantic-pr.yml:
- Line 5: Update the GitHub Actions workflow trigger by adding "reopened" to the
types list so the semantic PR check runs when a previously closed PR is
reopened; modify the existing types array (currently containing "opened",
"edited", "synchronize") to include "reopened" to ensure consistency for the
semantic-title check.
🪄 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: 500e7ad6-2602-4e44-85cc-c0cd7ade9743

📥 Commits

Reviewing files that changed from the base of the PR and between 5175238 and c0c5cd5.

📒 Files selected for processing (1)
  • .github/workflows/semantic-pr.yml

Comment on lines +14 to +16
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Find mutable action refs in workflows (tags like `@v5`):"
rg -n --glob '.github/workflows/*.yml' 'uses:\s*[^@]+@v?[0-9]+(\.[0-9]+)?$'

echo
echo "2) Resolve current object behind amannn/action-semantic-pull-request@v5:"
curl -fsSL https://api.github.com/repos/amannn/action-semantic-pull-request/git/ref/tags/v5 | jq -r '.object | "type=\(.type) sha=\(.sha)"'

echo
echo "If type=tag, resolve that tag object to the commit SHA before pinning."

Repository: smnatale/coderabbit.nvim

Length of output: 291


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Exploring repository structure ==="
ls -la .github/ 2>/dev/null || echo ".github/ not found"

echo
echo "=== Check if .github/workflows/ exists ==="
ls -la .github/workflows/ 2>/dev/null || echo ".github/workflows/ not found"

echo
echo "=== List all files in the repository to understand structure ==="
git ls-files | head -30

Repository: smnatale/coderabbit.nvim

Length of output: 1568


🏁 Script executed:

#!/bin/bash
cat -n .github/workflows/semantic-pr.yml

Repository: smnatale/coderabbit.nvim

Length of output: 981


🌐 Web query:

GitHub Actions security best practices mutable action tags pull_request_target

💡 Result:

GitHub Actions security best practices for mutable action tags and pull_request_target focus on preventing supply chain attacks and remote code execution (RCE). Key practices: 1. Pin actions to full-length commit SHAs for immutability: Avoid tags like @v1 or branches like @main, as they are mutable and can be hijacked. Use specific SHAs, e.g., uses: tj-actions/changed-files@abcdef1. This is the only way to ensure immutability. 2. For pull_request_target: Use only when necessary (e.g., labeling PRs needing write access). Never checkout untrusted PR code with actions/checkout using ref: ${{ github.event.pull_request.head.sha }}. This grants RCE with access to secrets and GITHUB_TOKEN (read/write by default). Instead, use pull_request for builds/tests (limited permissions), then workflow_run for privileged follow-ups after approval. 3. Additional mitigations: - Set explicit permissions: {contents: read} or job-level restrictions; default to read-only. - Avoid saving caches or artifacts in pull_request_target to prevent poisoning. - Require manual approval (e.g., 'safe to test' label) or restrict to same-repo PRs: if: github.event.pull_request.head.repo.full_name == github.repository. - Use verified creators from Marketplace; review/fork third-party actions. - Enable GitHub features: Dependabot for updates, CodeQL for scanning workflows, action allowlists. Recent changes (effective Dec 2025): pull_request_target always uses default branch for workflow source/ref, aligning with security model. Examples: Safe pull_request_target (labeling): on: pull_request_target permissions: pull-requests: write steps: - uses: actions/labeler@v4 # No checkout of PR head Unsafe (avoid): on: pull_request_target steps: - checkout: ref: ${{ github.event.pull_request.head.sha }} - run: npm install # Executes untrusted code with secrets

Citations:


Pin the third-party action to an immutable commit SHA.

This workflow uses pull_request_target (line 4), a privileged event that executes with access to secrets and tokens. The action reference on line 14 uses the mutable semantic version tag @v5, which could be compromised if the upstream maintainer's account is hijacked or a tag is force-pushed. Pin the action to a specific commit SHA for immutability and supply-chain security.

Suggested change
-      - uses: amannn/action-semantic-pull-request@v5
+      - uses: amannn/action-semantic-pull-request@<FULL_COMMIT_SHA> # v5

To find the commit SHA for v5, run: curl -s https://api.github.com/repos/amannn/action-semantic-pull-request/git/ref/tags/v5 | jq '.object.sha'

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

In @.github/workflows/semantic-pr.yml around lines 14 - 16, The workflow
currently references the third-party action as
amannn/action-semantic-pull-request@v5 (in the uses: line), which is mutable;
replace the tag with the corresponding immutable commit SHA for the v5 release
(e.g., amannn/action-semantic-pull-request@<commit-sha>) so the action is
pinned, and update the uses: entry accordingly; locate the uses:
amannn/action-semantic-pull-request@v5 string in the workflow and swap the tag
for the commit SHA obtained from the repo (ensure no other references to `@v5`
remain).

@smnatale smnatale closed this Apr 14, 2026
@smnatale smnatale deleted the chore/semantic-pr branch April 14, 2026 10:09
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