Repository navigation
v0.1.13
The reusable gate can fold its qualification check into the caller's required qualification job, so an opted-in tool pays for one aggregation job per run instead of two.
tool-gate.ymltakes a newcaller-qualificationinput (defaultfalse) and exposes alane-resultoutput: the status of the exact-SHA gate lane. A skipped lane emits nothing.- With
caller-qualification: true, the reusablegate / qualificationjob is skipped. The caller's ownqualificationjob must then run withif: always()and require bothneeds.gate.resultandneeds.gate.outputs.lane-resultto equalsuccess. A reusable workflow whose jobs were all skipped can report success, so checking its result alone is unsafe. Toolkit's.github/workflows/gate.ymlis the reference. - Don't opt in where branch protection requires
gate / qualification, because that check is skipped once you opt in. Repositories that require the plainqualificationcheck, or have no protection at all, can opt in. - On an opted-in caller, a draft PR fails with
gate not qualifiedrather thandraft: gate not run. It still fails closed. - The default leaves existing callers unchanged. The Go module API, CLI parsing and output are unchanged from v0.1.12, so no caller goldens should change.
Opting in means editing the caller's gate workflow:
jobs:
gate:
uses: 0xble/toolkit/.github/workflows/tool-gate.yml@v0.1.13
with:
caller-qualification: true
qualification:
runs-on: ubuntu-slim
needs: [gate]
if: always()
steps:
- env:
GATE_RESULT: ${{ needs.gate.result }}
LANE_RESULT: ${{ needs.gate.outputs.lane-result }}
run: |
[ "$GATE_RESULT" = success ] && [ "$LANE_RESULT" = success ]