Skip to content

Block fork pull request workflow jobs#179

Merged
dikshant-coderabbit merged 1 commit into
mainfrom
coderabbit/actions-lockdown-external-prs
May 12, 2026
Merged

Block fork pull request workflow jobs#179
dikshant-coderabbit merged 1 commit into
mainfrom
coderabbit/actions-lockdown-external-prs

Conversation

@harjotgill
Copy link
Copy Markdown
Contributor

@harjotgill harjotgill commented May 12, 2026

Summary

  • Skip GitHub Actions jobs for pull requests opened from forks.
  • Keep push, merge queue, issue, and same-repository pull request behavior unchanged.

Why

Public fork pull requests can run attacker-controlled workflow code. Skipping those jobs prevents those pull requests from reaching repository secrets through GitHub Actions.

Validation

  • Parsed the changed workflow files with yq e '.'.

Summary by CodeRabbit

  • Chores
    • Optimized continuous integration workflow configuration for improved development efficiency.

Review Change Stack

@harjotgill harjotgill requested a review from NatoBoram as a code owner May 12, 2026 16:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2b38d741-b62b-4921-bc31-2e317790d857

📥 Commits

Reviewing files that changed from the base of the PR and between 4fe2d08 and b48be63.

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

Walkthrough

Added conditional if: gates to three CI jobs (shellcheck, completions, test) in the lint workflow. Each job now restricts execution to non-PR events or pull requests originating from the same repository, preventing workflow runs on external fork contributions.

Changes

CI Job Security Gates

Layer / File(s) Summary
Conditional gates for CI jobs
.github/workflows/lint.yml
shellcheck, completions, and test jobs now include if: conditions to run only for non-PR events or PRs from the same repository.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three jobs now stand at the gate with care,
External forks? They shall not enter there!
Same repo PRs and direct commits flow free,
A safer workflow, efficient and key! 🔐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Block fork pull request workflow jobs' accurately and concisely describes the main change—restricting GitHub Actions workflow jobs from running on pull requests from forks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 coderabbit/actions-lockdown-external-prs

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

@dikshant-coderabbit dikshant-coderabbit merged commit 828413f into main May 12, 2026
4 checks passed
@dikshant-coderabbit dikshant-coderabbit deleted the coderabbit/actions-lockdown-external-prs branch May 12, 2026 17:38
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.

2 participants