forked from zcash/zcash
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (38 loc) · 1.31 KB
/
checks.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
name: Checks
on: pull_request_target
permissions:
contents: read
issues: write
pull-requests: write
jobs:
recent-base:
name: Branch base is sufficiently recent
runs-on: ubuntu-latest
steps:
- name: Check out the base branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out the PR branch
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Ensure branch contains necessary commits for Tekton CI
id: tekton
# https://github.com/zcash/zcash/pull/6358
run: git merge-base --is-ancestor 267ddf8efe36cc799c4c31772a8883ea332ef55b ${{ github.head_ref }}
- name: Tell PR author if they need to rebase
if: failure() && steps.tekton.outcome == 'failure'
run: echo "::error::Branch needs to be rebased so that Tekton CI can run"
- name: Avoid running Tekton CI if it would provably fail
if: failure() && steps.tekton.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: "safe-to-build",
})