Skip to content

[ci] Added fork guard to repository management workflows#532

Merged
nemesifier merged 1 commit into
openwisp:masterfrom
asmodehn:prevent_github_workflow_in_forks
Jun 30, 2026
Merged

[ci] Added fork guard to repository management workflows#532
nemesifier merged 1 commit into
openwisp:masterfrom
asmodehn:prevent_github_workflow_in_forks

Conversation

@asmodehn

@asmodehn asmodehn commented Jun 30, 2026

Copy link
Copy Markdown
Member

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Description of Changes

This PR adds safeguards to GitHub workflows to prevent them from being triggered in forked repositories.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Multiple GitHub Actions workflow files are updated to add github.repository == 'openwisp/openwisp-users' guards on job-level if conditions, preventing jobs from running when workflows are reused in forked repositories. Several existing if expressions are also reformatted from single-line to multiline folded YAML (if: >) style without changing their logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • openwisp/openwisp-users#496: Introduced the bot-changelog-runner.yml workflow whose job if conditions are directly modified in this PR.

Suggested labels

github_actions

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR follows the template partially, but it omits the issue reference and screenshot and gives only a vague change summary. Add the issue reference, screenshot section, and a more specific description of the workflow guard changes.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Bug Fixes ✅ Passed PASS: Changes are GitHub Actions workflow guards only; no core user-facing bug fix, so regression tests/Selenium are not applicable.
Title check ✅ Passed The title uses the required [ci] type and accurately summarizes the repository-guard workflow changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot added the github_actions Pull requests that update GitHub Actions code label Jun 30, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.15% (+0.02%) from 98.128% — asmodehn:prevent_github_workflow_in_forks into openwisp:master

@nemesifier nemesifier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @asmodehn

@nemesifier nemesifier changed the title [chores] Added fork guard to non-CI workflows [ci] Added fork guard to repository management workflows Jun 30, 2026
@nemesifier
nemesifier merged commit 122886e into openwisp:master Jun 30, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants