diff --git a/.github/workflows/docker-build-dispatch.yml b/.github/workflows/docker-build-dispatch.yml deleted file mode 100644 index cf9f5f5ef6..0000000000 --- a/.github/workflows/docker-build-dispatch.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Sets the docker-build commit status (pending) and triggers the image build for a PR commit. -name: Docker build dispatch - -on: - workflow_run: - workflows: ["Docker build trigger"] - types: [completed] - -permissions: - contents: read - statuses: write - -concurrency: - group: docker-build-dispatch-${{ github.event.workflow_run.head_sha }} - cancel-in-progress: true - -jobs: - dispatch: - name: Post status + dispatch build - if: >- - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_repository.full_name == github.repository - runs-on: ubuntu-latest - steps: - - name: Set docker-build status (pending) - env: - GH_TOKEN: ${{ github.token }} - REPO: ${{ github.repository }} - HEAD_SHA: ${{ github.event.workflow_run.head_sha }} - run: | - set -euo pipefail - gh api -X POST "/repos/${REPO}/statuses/${HEAD_SHA}" \ - -f state='pending' \ - -f context='docker-build' \ - -f description='Queued — waiting for build to start.' - - - name: Dispatch build - env: - GH_TOKEN: ${{ secrets.CI_DISPATCH_TOKEN }} - DISPATCH_REPO: ${{ secrets.CI_DISPATCH_REPO }} - REF: ${{ github.event.workflow_run.head_sha }} - run: | - set -euo pipefail - jq -n \ - --arg ref "${REF}" \ - '{event_type: "docker-pr-build", client_payload: {ref: $ref}}' \ - | gh api -X POST "/repos/${DISPATCH_REPO}/dispatches" --input - diff --git a/.github/workflows/docker-build-liveness.yml b/.github/workflows/docker-build-liveness.yml deleted file mode 100644 index 7b044c553e..0000000000 --- a/.github/workflows/docker-build-liveness.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Fails docker-build statuses that never completed. -name: Docker build liveness - -on: - schedule: - - cron: "*/15 * * * *" - workflow_dispatch: {} - -permissions: - contents: read - statuses: write - -jobs: - reap: - name: Fail stale docker-build statuses - runs-on: ubuntu-latest - steps: - - name: Reap stale statuses - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 - env: - TIMEOUT_MIN: ${{ vars.DOCKER_BUILD_TIMEOUT_MIN || '90' }} - with: - github-token: ${{ github.token }} - script: | - const timeoutMin = Number(process.env.TIMEOUT_MIN); - const now = Date.now(); - const { owner, repo } = context.repo; - - const prs = await github.paginate(github.rest.pulls.list, { - owner, repo, state: 'open', per_page: 100, - }); - - let failed = 0; - for (const pr of prs) { - const { data } = await github.rest.repos.getCombinedStatusForRef({ - owner, repo, ref: pr.head.sha, - }); - const status = data.statuses.find((s) => s.context === 'docker-build'); - if (!status || status.state !== 'pending') continue; - - const ageMin = (now - new Date(status.created_at).getTime()) / 60000; - if (ageMin <= timeoutMin) continue; - - await github.rest.repos.createCommitStatus({ - owner, repo, sha: pr.head.sha, - state: 'failure', context: 'docker-build', - description: 'Build timed out — re-run "Docker build trigger" in Actions.', - }); - failed++; - core.info(`Failed stale docker-build (pending, ${ageMin.toFixed(1)}m) on PR #${pr.number} @ ${pr.head.sha}`); - } - core.info(`Reaped ${failed} stale docker-build status(es) across ${prs.length} open PR(s).`); diff --git a/.github/workflows/docker-build-trigger.yml b/.github/workflows/docker-build-trigger.yml deleted file mode 100644 index 2f182ccebc..0000000000 --- a/.github/workflows/docker-build-trigger.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Triggers the Docker build check on pull requests. -name: Docker build trigger - -on: - pull_request: - types: [opened, synchronize, reopened] - -permissions: - contents: read - -concurrency: - group: docker-build-trigger-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - requested: - name: Signal docker build requested - runs-on: ubuntu-latest - steps: - - run: echo "Docker build requested."