Repository navigation
merge retirements, feed and eol into one notices kind (I19.6) #67
Workflow file for this run
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
| # contract/fixtures/ is a copy of patch-it's fixtures/ (the change-event contract | |
| # patch-it owns). This fails when the two drift apart, so core/event/ and core/migrate/ test | |
| # the same events the patch-it client does. Only top-level "_comment" fields may | |
| # differ (scripts/check_contract.py). | |
| # | |
| # patch-it is cloned anonymously, with no token. While patch-it isn't public yet the | |
| # clone can't see it, and the check passes with a notice. | |
| # | |
| # Whether patch-it is readable is asked of the API with this workflow's own token: | |
| # it can't read patch-it either (a private repo answers 404 to it, as to anyone), | |
| # but it isn't subject to the 60-an-hour limit GitHub puts on anonymous requests | |
| # from each runner's shared IP. Asked anonymously, a run got something other than | |
| # 404 (most likely 403 from that limit; the code wasn't logged), went on to clone, | |
| # and failed (PR #109, 2026-11-19). Only 404 skips; any | |
| # other answer but 200 fails, with the code, so a check that didn't run never | |
| # shows green. | |
| name: CI_contract | |
| on: | |
| pull_request: | |
| merge_group: | |
| schedule: | |
| - cron: "17 5 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| # A new push cancels the run it supersedes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| contract: | |
| name: contract fixtures match patch-it | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: clone patch-it's fixtures (anonymous) | |
| id: upstream | |
| env: | |
| GIT_TERMINAL_PROMPT: "0" | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| code=$(curl -s -o /dev/null -w '%{http_code}' --retry 2 \ | |
| -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/patch-it-dev/patch-it) | |
| if [ "$code" = "404" ]; then | |
| echo "::notice::patch-it-dev/patch-it isn't publicly readable yet (the API answered 404); skipping the contract check." | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [ "$code" != "200" ]; then | |
| echo "::error::Asked whether patch-it-dev/patch-it is readable, the GitHub API answered $code, not 200 or 404; the contract check didn't run." | |
| exit 1 | |
| fi | |
| git -c credential.helper= clone --quiet --depth 1 --filter=blob:none --sparse \ | |
| https://github.com/patch-it-dev/patch-it upstream | |
| git -C upstream sparse-checkout set fixtures | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| - name: compare | |
| if: steps.upstream.outputs.present == 'true' | |
| run: python3 scripts/check_contract.py upstream/fixtures |