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