Use the runner output file for deployment workflows
Some checks failed
Validate and deploy Sokko G / validate (push) Successful in 17m27s
Validate and deploy Sokko G / deploy (push) Failing after 4s

This commit is contained in:
Shinuwa 2026-10-23 21:24:41 +02:00
parent c0e18d6561
commit 8e8e7ba8d6
3 changed files with 7 additions and 4 deletions

View file

@ -44,7 +44,7 @@ jobs:
commit="$(git rev-parse HEAD)"
printf '%s' "$commit" | grep -Eq '^[0-9a-f]{40}$'
git merge-base --is-ancestor "$commit" origin/main
printf 'sha=%s\n' "$commit" >> "$GITEA_OUTPUT"
printf 'sha=%s\n' "$commit" >> "$GITHUB_OUTPUT"
node --version
npm --version

View file

@ -36,7 +36,7 @@ jobs:
run: |
commit="$(git rev-parse HEAD)"
test "$commit" = "$PUSHED_COMMIT"
printf 'sha=%s\n' "$commit" >> "$GITEA_OUTPUT"
printf 'sha=%s\n' "$commit" >> "$GITHUB_OUTPUT"
- name: Install dependencies from the lockfile
run: npm ci
@ -69,7 +69,7 @@ jobs:
else
printf 'Skipping stale commit %s; main is now %s.\n' "$DEPLOY_COMMIT" "$current_commit"
fi
printf 'deploy=%s\n' "$deploy" >> "$GITEA_OUTPUT"
printf 'deploy=%s\n' "$deploy" >> "$GITHUB_OUTPUT"
- name: Install the deployment clients
if: steps.freshness.outputs.deploy == 'true'

View file

@ -24,6 +24,7 @@ test("main pushes validate then automatically deploy the same current commit", a
assert.match(workflow, /npm run check:full/);
assert.match(workflow, /deploy:\s+[\s\S]*needs: validate/);
assert.match(workflow, /DEPLOY_COMMIT: \$\{\{ needs\.validate\.outputs\.commit \}\}/);
assert.match(workflow, />> "\$GITHUB_OUTPUT"/);
assert.match(workflow, /steps\.freshness\.outputs\.deploy == 'true'/);
assert.match(workflow, /current_commit[\s\S]*DEPLOY_COMMIT/);
assert.match(workflow, /deploy-contract/);
@ -34,6 +35,7 @@ test("main pushes validate then automatically deploy the same current commit", a
assert.doesNotMatch(workflow, /workflow_dispatch:/);
assert.doesNotMatch(workflow, /StrictHostKeyChecking=no/);
assert.doesNotMatch(workflow, /192\.168\.0\.100/);
assert.doesNotMatch(workflow, /GITEA_OUTPUT/);
assert.doesNotMatch(validateJob, /secrets\./);
assert.doesNotMatch(validateJob, /\bssh\b/);
});
@ -49,7 +51,7 @@ test("production deployment requires a validated exact commit and pinned SSH hos
assert.match(workflow, /npm ci/);
assert.match(workflow, /npm run check:full/);
assert.match(workflow, /git merge-base --is-ancestor "\$commit" origin\/main/);
assert.match(workflow, />> "\$GITEA_OUTPUT"/);
assert.match(workflow, />> "\$GITHUB_OUTPUT"/);
assert.match(workflow, /DEPLOY_COMMIT: \$\{\{ needs\.validate\.outputs\.commit \}\}/);
assert.match(workflow, /deploy-contract/);
assert.match(workflow, /deploy-sokko-g --commit/);
@ -58,6 +60,7 @@ test("production deployment requires a validated exact commit and pinned SSH hos
assert.match(workflow, /StrictHostKeyChecking=yes/);
assert.doesNotMatch(workflow, /StrictHostKeyChecking=no/);
assert.doesNotMatch(workflow, /192\.168\.0\.100/);
assert.doesNotMatch(workflow, /GITEA_OUTPUT/);
assert.doesNotMatch(workflow, /\$\{\{\s*forgejo\./);
});