|
| 1 | +# Please ping @DilumAluthge when making any changes to this file. |
| 2 | + |
| 3 | +# Here are some steps that we take in this workflow file for security reasons: |
| 4 | +# 1. We do not checkout any code. |
| 5 | +# 2. We only run actions that are defined in a repository in the `JuliaLang` GitHub organization. |
| 6 | +# 3. We do not give the `GITHUB_TOKEN` any permissions. |
| 7 | +# 4. We only give the Buildkite API token (`BUILDKITE_API_TOKEN_RETRY`) the minimum necessary |
| 8 | +# set of permissions. |
| 9 | + |
| 10 | +# Important note to Buildkite maintainers: |
| 11 | +# In order to make this work, you need to tell Buildkite that it should NOT create a brand-new |
| 12 | +# build when someone closes and reopens a pull request. To do so: |
| 13 | +# 1. Go to the relevant pipeline (e.g. https://buildkite.com/julialang/julia-master). |
| 14 | +# 2. Click on the "Pipeline Settings" button. |
| 15 | +# 3. In the left sidebar, under "Pipeline Settings", click on "GitHub". |
| 16 | +# 4. In the "GitHub Settings", under "Build Pull Requests", make sure that the "Skip pull |
| 17 | +# request builds for existing commits" checkbox is checked. This is the setting that tells |
| 18 | +# Buildkite that it should NOT create a brand-new build when someone closes and reopens a |
| 19 | +# pull request. |
| 20 | +# 5. At the bottom of the page, click the "Save GitHub Settings" button. |
| 21 | + |
| 22 | +name: Retry Failed Buildkite Jobs |
| 23 | + |
| 24 | +on: |
| 25 | + # When using the `pull_request_target` event, all PRs will get access to secret environment |
| 26 | + # variables (such as the `BUILDKITE_API_TOKEN_RETRY` secret environment variable), even if |
| 27 | + # the PR is from a fork. Therefore, for security reasons, we do not checkout any code in |
| 28 | + # this workflow. |
| 29 | + pull_request_target: |
| 30 | + |
| 31 | + # TODO: delete the following line (once we have completely transitioned from Buildbot to Buildkite) |
| 32 | + types: [ reopened, labeled ] |
| 33 | + |
| 34 | + # TODO: uncomment the following line (once we have completely transitioned from Buildbot to Buildkite) |
| 35 | + # types: [ reopened ] |
| 36 | + |
| 37 | +# We do not give the `GITHUB_TOKEN` any permissions. |
| 38 | +permissions: |
| 39 | + statuses: none |
| 40 | + |
| 41 | +jobs: |
| 42 | + retry: |
| 43 | + name: retry |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + # TODO: delete the following line (once we have completely transitioned from Buildbot to Buildkite) |
| 47 | + if: github.repository == 'JuliaLang/julia' && (github.event.label.name == 'Buildkite - retry failed jobs' || github.event.action == 'reopened') |
| 48 | + |
| 49 | + # TODO: uncomment the following line (once we have completely transitioned from Buildbot to Buildkite) |
| 50 | + # if: github.repository == 'JuliaLang/julia' |
| 51 | + |
| 52 | + steps: |
| 53 | + # For security reasons, we do not checkout any code in this workflow. |
| 54 | + - uses: JuliaLang/retry-buildkite@24e8341f74e0d6760717235eac936db639d7e9eb |
| 55 | + with: |
| 56 | + buildkite_api_token: ${{ secrets.BUILDKITE_API_TOKEN_RETRY }} |
| 57 | + buildkite_organization_slug: 'julialang' |
| 58 | + buildkite_pipeline_slug: 'julia-master' |
| 59 | + pr_number: ${{github.event.number}} |
0 commit comments