-
Notifications
You must be signed in to change notification settings - Fork 0
chore(release): promote dev to main (post marketplace-06 CI signing) #189
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
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
84d94bc
feat(openspec): add marketplace-06-ci-module-signing change proposal
djm81 e026c6c
fix(openspec): move marketplace-06 to correct parent hierarchy
djm81 4f48732
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli-modules…
djm81 4914f12
feat(ci): branch-aware module verify and sign on PR approval
djm81 81116d2
docs(openspec): record PR 188 and task progress for marketplace-06
djm81 b386cb3
fix(pre-commit): branch-aware module verify (match CI main-only signa…
djm81 c047352
fix(ci): address review feedback on sign-modules-on-approval
djm81 9b9ecf9
fix(ci): harden sign-modules-on-approval for forks and merge-base
cursoragent f513a39
test(ci): assert sign workflow concurrency and permissions; pre-commi…
djm81 f9d13c6
Merge pull request #188 from nold-ai/feature/marketplace-06-ci-module…
djm81 d76e6dd
docs: document branch-aware signing, CI approval workflow, pre-commit…
djm81 f3a3e99
Merge branch 'main' into dev
djm81 edbe0a9
fix(ci,pre-commit): address signing and review-gate review findings
djm81 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
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,108 @@ | ||
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
| name: sign-modules-on-approval | ||
|
|
||
| on: | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
|
||
| concurrency: | ||
| group: sign-modules-on-approval-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| sign-modules: | ||
| if: >- | ||
| github.event.review.state == 'approved' && | ||
| (github.event.pull_request.base.ref == 'dev' || github.event.pull_request.base.ref == 'main') && | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SPECFACT_MODULE_PRIVATE_SIGN_KEY: ${{ secrets.SPECFACT_MODULE_PRIVATE_SIGN_KEY }} | ||
| SPECFACT_MODULE_PRIVATE_SIGN_KEY_PASSPHRASE: ${{ secrets.SPECFACT_MODULE_PRIVATE_SIGN_KEY_PASSPHRASE }} | ||
| PR_BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
| PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} | ||
| steps: | ||
| - name: Guard signing secrets | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -z "${SPECFACT_MODULE_PRIVATE_SIGN_KEY:-}" ]; then | ||
| echo "::error::Missing secret: SPECFACT_MODULE_PRIVATE_SIGN_KEY" | ||
| exit 1 | ||
| fi | ||
| if [ -z "${SPECFACT_MODULE_PRIVATE_SIGN_KEY_PASSPHRASE:-}" ]; then | ||
| echo "::error::Missing secret: SPECFACT_MODULE_PRIVATE_SIGN_KEY_PASSPHRASE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Python 3.12 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install signing dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install pyyaml beartype icontract cryptography cffi | ||
|
|
||
| - name: Discover module manifests | ||
| id: discover | ||
| run: | | ||
| set -euo pipefail | ||
| mapfile -t MANIFESTS < <(find packages -name 'module-package.yaml' -type f | sort) | ||
| echo "manifests_count=${#MANIFESTS[@]}" >> "$GITHUB_OUTPUT" | ||
| echo "Discovered ${#MANIFESTS[@]} module-package.yaml file(s) under packages/" | ||
|
|
||
| - name: Sign changed module manifests | ||
| id: sign | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch origin "${PR_BASE_REF}" --no-tags | ||
| MERGE_BASE="$(git merge-base HEAD "origin/${PR_BASE_REF}")" | ||
| python scripts/sign-modules.py \ | ||
| --changed-only \ | ||
| --base-ref "$MERGE_BASE" \ | ||
| --bump-version patch \ | ||
| --payload-from-filesystem | ||
|
|
||
| - name: Commit and push signed manifests | ||
| id: commit | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| if [ -z "$(git status --porcelain -- packages/)" ]; then | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "No manifest changes to commit." | ||
| exit 0 | ||
| fi | ||
| git add -u -- packages/ | ||
| git commit -m "chore(modules): ci sign changed modules [skip ci]" | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| if ! git push origin "HEAD:${PR_HEAD_REF}"; then | ||
| echo "::error::Push to ${PR_HEAD_REF} failed (branch may have advanced after the approved commit). Update the PR branch and re-approve if signing is still required." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Write job summary | ||
| if: always() | ||
| env: | ||
| COMMIT_CHANGED: ${{ steps.commit.outputs.changed }} | ||
| MANIFESTS_COUNT: ${{ steps.discover.outputs.manifests_count }} | ||
| run: | | ||
| { | ||
| echo "### Module signing (CI approval)" | ||
| echo "Manifests discovered under \`packages/\`: ${MANIFESTS_COUNT:-unknown}" | ||
| if [ "${COMMIT_CHANGED}" = "true" ]; then | ||
| echo "Committed signed manifest updates to ${PR_HEAD_REF}." | ||
| else | ||
| echo "No changes detected (manifests already signed or no module changes on this PR vs merge-base)." | ||
| fi | ||
| } >> "$GITHUB_STEP_SUMMARY" |
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
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
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.