Skip to content

Commit 45108f9

Browse files
test(signed-push): manual smoke workflow (asserts Verified end-to-end) (#510)
Follow-up to #509 (which merged the `signed-push` action). Adds a **manual** (`workflow_dispatch`) smoke test that proves the action produces GitHub-**Verified** commits end-to-end. ## What it does 1. Creates a throwaway branch `ci/signed-push-smoke-<run>`. 2. Commits a trivial change locally. 3. Pushes it via `./.github/actions/signed-push` (App token → `createCommitOnBranch`). 4. **Asserts** the resulting commit is `verified=true` (fails loudly if not — the classic "App not installed / wrong secret" case). 5. Deletes the throwaway branch. ## Before running Set on this repo (Settings → Secrets and variables → Actions): - Variable **`APP_ID`**, Secret **`APP_PRIVATE_KEY`** — the estate GitHub App. Then: Actions → "signed-push smoke test" → Run workflow (on this branch). Green = Arm B1 works. Validated: `actionlint` clean, YAML parses, checkout SHA-pinned. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5359863 commit 45108f9

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# End-to-end check for the signed-push composite action: pushes a throwaway commit
3+
# via the GitHub App and asserts GitHub marks it "Verified". Manual trigger only.
4+
# Requires repo/org secret APP_PRIVATE_KEY and variable APP_ID (the estate App).
5+
name: signed-push smoke test
6+
7+
on:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
smoke:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Create throwaway branch + a local commit
23+
id: prep
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
BRANCH="ci/signed-push-smoke-${GITHUB_RUN_ID}"
28+
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
29+
git config user.name "estate-committer[bot]"
30+
git config user.email "estate-committer[bot]@users.noreply.github.com"
31+
git checkout -b "$BRANCH"
32+
# Create the remote branch at the current base so createCommitOnBranch has
33+
# an existing ref to commit onto, then fetch its tracking ref for the diff.
34+
git push origin "$BRANCH"
35+
git fetch origin "$BRANCH"
36+
# Trivial change to be pushed as a Verified commit.
37+
mkdir -p .ci-smoke
38+
date -u +"%Y-%m-%dT%H:%M:%SZ" > .ci-smoke/last-signed-push.txt
39+
git add .ci-smoke/last-signed-push.txt
40+
git commit -m "test(signed-push): verified-commit smoke [run ${GITHUB_RUN_ID}]"
41+
42+
- name: Push the local commit as Verified (via the App)
43+
uses: ./.github/actions/signed-push
44+
with:
45+
app-id: ${{ vars.APP_ID }}
46+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
47+
branch: ${{ steps.prep.outputs.branch }}
48+
49+
- name: Assert Verified, then delete the throwaway branch
50+
shell: bash
51+
env:
52+
GH_TOKEN: ${{ github.token }}
53+
BRANCH: ${{ steps.prep.outputs.branch }}
54+
run: |
55+
set -euo pipefail
56+
SHA=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${BRANCH}" --jq '.sha')
57+
read -r VERIFIED REASON < <(gh api "repos/${GITHUB_REPOSITORY}/commits/${SHA}" \
58+
--jq '.commit.verification | "\(.verified) \(.reason)"')
59+
echo "head ${SHA} → verified=${VERIFIED} reason=${REASON}"
60+
# Always clean up the throwaway branch.
61+
git push origin --delete "$BRANCH" || true
62+
if [ "$VERIFIED" != "true" ]; then
63+
echo "::error::signed-push produced an UNVERIFIED commit (reason=${REASON}). Check that APP_ID/APP_PRIVATE_KEY are set and the App is installed on this repo."
64+
exit 1
65+
fi
66+
echo "✅ signed-push produced a Verified commit — Arm B1 works end-to-end."

0 commit comments

Comments
 (0)