Repository navigation
chore: sync 1 org-standard workflow stub(s) from petry-projects/.github #474
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
59e14c2
chore: sync 1 org-standard workflow stub(s) from petry-projects/.github
don-petry 504d103
chore: dev-lead update (review-changes) [skip ci-relay]
don-petry 4c61260
Merge branch 'main' into standards-sync/workflows-20260908
don-petry 8d8b104
Merge branch 'main' into standards-sync/workflows-20260908
don-petry 532cf89
Merge branch 'main' into standards-sync/workflows-20260908
don-petry 5dc1df1
fix(bot): address bot feedback [skip ci-relay]
don-petry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,55 @@ | ||
| # Apply repository settings — disables check-suite auto-triggers (including | ||
| # Claude app 1236702) that permanently block auto-merge, and enforces all other | ||
| # required settings from standards/github-settings.md. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # SOURCE OF TRUTH: petry-projects/.github/standards/workflows/apply-repo-settings.yml | ||
| # Standard: petry-projects/.github/standards/github-settings.md | ||
| # petry-projects/.github/standards/ruleset-remediation-runbook.md | ||
| # Reusable: petry-projects/.github/.github/workflows/apply-repo-settings-reusable.yml | ||
| # | ||
| # Triggers: | ||
| # • workflow_dispatch — manual run to fix current state immediately | ||
| # • push to main on the settings script — re-applies on every future change | ||
| # • schedule — weekly re-apply so codified rulesets self-heal live drift. | ||
| # Without this, a ruleset that is manually changed in the GitHub UI (e.g. | ||
| # pr-quality's require_last_push_approval flipped to false) stays drifted | ||
| # until someone edits a script path, which is why compliance drift findings | ||
| # recurred (#325 → #403). The apply scripts are idempotent, so re-running is | ||
| # safe. | ||
| # AGENTS — READ BEFORE EDITING: | ||
| # • This file is a THIN CALLER STUB. All settings/ruleset logic lives in the | ||
| # reusable workflow above; consumer repos carry NO script copy. | ||
| # • You MAY change: the cron offset only (stagger org API load). | ||
| # • You MUST NOT change: the `uses:` line, `secrets: inherit`, the job-level | ||
| # `permissions:` block, or the `checkout_ref` forward — reusable workflows can | ||
| # be granted no more permissions than the calling job has, and forwarding an | ||
| # input the pinned channel does not declare breaks every run at startup (#1034). | ||
| # • If you need different behaviour, open a PR against the reusable in the | ||
| # central repo. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # | ||
| # Required secret: GH_TOKEN_ADMIN — a classic PAT or fine-grained token with | ||
| # administration:write (repo admin) scope for petry-projects/markets. | ||
| # Apply repo settings — thin caller for the org-level compliance self-heal. | ||
| # To adopt: copy this file verbatim to .github/workflows/apply-repo-settings.yml. | ||
| # Required org secret (inherited): | ||
| # GH_PAT_DON_PETRY — classic PAT, repo scope, owner has admin on this repo. | ||
| name: Apply repo settings | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "23 5 * * 1" | ||
| # Weekly self-heal. The cron offset MAY be changed to stagger org API load. | ||
| - cron: '17 6 * * 1' | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: "Preview changes without applying" | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - .github/scripts/apply-repo-settings.sh | ||
| - .github/scripts/apply-code-quality-ruleset.sh | ||
| - .github/scripts/apply-pr-quality-ruleset.sh | ||
| - .github/workflows/apply-repo-settings.yml | ||
| - '.github/workflows/apply-repo-settings.yml' | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: apply-repo-settings | ||
| cancel-in-progress: false | ||
|
codeant-ai[bot] marked this conversation as resolved.
|
||
|
|
||
| jobs: | ||
| apply-settings: | ||
| name: Apply repo settings | ||
| runs-on: ubuntu-latest | ||
| apply: | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| # Preflight — without GH_TOKEN_ADMIN the apply step dies with a generic | ||
| # "GH_TOKEN is required" buried in the script log, so the weekly self-heal | ||
| # fails unnoticed and ruleset drift recurs (#325 → #403 → #420). Surface the | ||
| # missing secret loudly (error annotation + job summary) so it gets fixed. | ||
| - name: Verify admin token is configured | ||
| env: | ||
| GH_TOKEN_ADMIN: ${{ secrets.GH_TOKEN_ADMIN }} | ||
| run: | | ||
| if [ -z "${GH_TOKEN_ADMIN}" ]; then | ||
| { | ||
| echo "## Apply repo settings cannot run" | ||
| echo "" | ||
| echo "The \`GH_TOKEN_ADMIN\` secret is not configured for this repository." | ||
| echo "Without it the pr-quality / code-quality rulesets cannot self-heal, so" | ||
| echo "compliance drift (e.g. \`require_last_push_approval\` flipping to false)" | ||
| echo "recurs unnoticed." | ||
| echo "" | ||
| echo "**Fix:** provision a repo/org admin token secret named \`GH_TOKEN_ADMIN\`" | ||
| echo "with \`administration:write\` scope (see standards/github-settings.md)," | ||
| echo "then re-run this workflow." | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
| echo "::error title=GH_TOKEN_ADMIN missing::Provision the GH_TOKEN_ADMIN secret so ruleset drift can self-heal (see job summary)." | ||
| exit 1 | ||
| fi | ||
| echo "GH_TOKEN_ADMIN is configured." | ||
|
|
||
| - name: Apply repo settings | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} | ||
| run: bash .github/scripts/apply-repo-settings.sh | ||
| uses: petry-projects/.github/.github/workflows/apply-repo-settings-reusable.yml@apply-repo-settings/v1-ring1 # NOSONAR(githubactions:S7637) first-party channel ref | ||
|
don-petry marked this conversation as resolved.
|
||
| with: | ||
| dry_run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }} | ||
| checkout_ref: apply-repo-settings/v1-ring1 # keep in lockstep with the uses: channel pin | ||
| secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.