From ff6b39e51bb8162ecfbda313003b6e3e9e744df5 Mon Sep 17 00:00:00 2001 From: s3krit Date: Fri, 19 Jun 2020 08:59:59 +0200 Subject: [PATCH] [CI] Label PRs if polkadot companion build fails (#6410) * add polkadot-companion-labels.yml * fix polkadot companion job name * add opened event to polkadot-companion-labels.yml * Dont label on timeouts * increase timeouts * increase timeouts again... to be sure * Switch to s3krit/await-status-action Turns out Sibz/await-status-action looks at /ref/statuses, which lists ALL statuses (i.e., if you send a pending and a failure for the same context, it will see both and assume the job is still pending.). I forked and point at /ref/status, which shows a combined summary of each status (i.e., only ever shows the most recent status of a single context). --- .../workflows/polkadot-companion-labels.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 substrate/.github/workflows/polkadot-companion-labels.yml diff --git a/substrate/.github/workflows/polkadot-companion-labels.yml b/substrate/.github/workflows/polkadot-companion-labels.yml new file mode 100644 index 0000000000..dd00e72d6c --- /dev/null +++ b/substrate/.github/workflows/polkadot-companion-labels.yml @@ -0,0 +1,29 @@ +name: Check Polkadot Companion and Label + +on: + pull_request: + types: [opened, synchronize] + +jobs: + check_status: + runs-on: ubuntu-latest + steps: + - name: Monitor the status of the gitlab-check-companion-build job + uses: s3krit/await-status-action@4528ebbdf6e29bbec77c41caad1b2dec148ba894 + id: 'check-companion-status' + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha }} + contexts: 'continuous-integration/gitlab-check-polkadot-companion-build' + timeout: 1800 + notPresentTimeout: 3600 # It can take quite a while before the job starts... + - name: Label success + uses: andymckay/labeler@master + if: steps.check-companion-status.outputs.result == 'success' + with: + remove-labels: 'A7-needspolkadotpr' + - name: Label failure + uses: andymckay/labeler@master + if: steps.check-companion-status.outputs.result == 'failure' + with: + add-labels: 'A7-needspolkadotpr'