-
-
Notifications
You must be signed in to change notification settings - Fork 8
fix(ci): secure fork pr ci #46
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
4 commits
Select commit
Hold shift + click to select a range
cbe3519
Fix secure fork PR workflow boundaries
randoneering 0c0bdb7
Fix secure fork PR workflow boundaries
randoneering f60d830
Ignore and untrack local superpowers docs
randoneering bdad54e
fix(ci): add trusted pr-workflow-guard and pin pr-safe-checks uv
randoneering 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
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
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 |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: PR Safe Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| safe-checks: | ||
| name: PR Safe Checks | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout PR head | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | ||
| with: | ||
| version: "0.12.9" | ||
| checksum: "ec7a99cd05e0cd7f80243f135ce1361c76835cb0ee60055d14d20eba8eba1460" | ||
| enable-cache: true | ||
|
|
||
| - name: Sync dependencies | ||
| run: uv sync --frozen | ||
|
|
||
| - name: Run pure contract tests | ||
| run: | | ||
| uv run pytest -q \ | ||
| testing/test_workflow_security.py \ | ||
| testing/integration/tests/integration/test_pgtap_suite.py::test_every_health_check_has_pgtap_coverage \ | ||
| testing/integration/tests/integration/test_pgtap_suite.py::test_both_view_sql_files_cover_all_health_checks |
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 |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Workflow Security Guard | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| workflow-security: | ||
| name: Workflow Security Guard | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout base | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | ||
| with: | ||
| version: "0.12.9" | ||
| checksum: "ec7a99cd05e0cd7f80243f135ce1361c76835cb0ee60055d14d20eba8eba1460" | ||
| enable-cache: true | ||
|
|
||
| - name: Sync dependencies | ||
| run: uv sync --frozen | ||
|
|
||
| - name: Fetch PR workflow files as data | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p /tmp/pr-workflows /tmp/pr-distributed | ||
| for f in \ | ||
| pr-safe-checks.yml \ | ||
| pr-workflow-guard.yml \ | ||
| neon-before-after-validate.yml \ | ||
| neon-integration-pg-matrix.yml \ | ||
| nixos-local-test.yml; do | ||
| gh api \ | ||
| "repos/${HEAD_REPO}/contents/.github/workflows/${f}?ref=${HEAD_SHA}" \ | ||
| --jq .content | base64 -d > "/tmp/pr-workflows/${f}" | ||
| done | ||
| gh api \ | ||
| "repos/${HEAD_REPO}/contents/workflows/neon-before-after-validate.yml?ref=${HEAD_SHA}" \ | ||
| --jq .content | base64 -d > /tmp/pr-distributed/neon-before-after-validate.yml | ||
|
|
||
| - name: Overlay PR YAML for verifier | ||
| run: | | ||
| set -euo pipefail | ||
| cp /tmp/pr-workflows/*.yml .github/workflows/ | ||
| mkdir -p workflows | ||
| cp /tmp/pr-distributed/neon-before-after-validate.yml workflows/neon-before-after-validate.yml | ||
|
|
||
| - name: Run trusted verifier | ||
| run: uv run pytest -q testing/test_workflow_security.py |
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 |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ AGENTS.md | |
| CLAUDE.md | ||
|
|
||
| # Local docs | ||
| docs/superpowers/plans/ | ||
| docs/superpowers/ | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
|
|
||
Oops, something went wrong.
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.