-
Notifications
You must be signed in to change notification settings - Fork 31
67 lines (56 loc) · 2.06 KB
/
test-pull-request.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
60
61
62
63
64
65
66
67
name: Test Pull Request
on:
pull_request:
branches:
- master
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Checkout
uses: actions/checkout@v3
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- name: Run Unit Tests
run: |
go test ./...
approve:
name: Approve Bot PRs
if: ${{ github.event.pull_request.user.login == 'cf-buildpacks-eng' || github.event.pull_request.user.login == 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: unit
steps:
- name: Check Commit Verification
id: unverified-commits
uses: paketo-buildpacks/github-config/actions/pull-request/check-unverified-commits@main
with:
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
repo: ${{ github.repository }}
number: ${{ github.event.number }}
- name: Check for Human Commits
id: human-commits
uses: paketo-buildpacks/github-config/actions/pull-request/check-human-commits@main
with:
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
repo: ${{ github.repository }}
number: ${{ github.event.number }}
bots: 'dependabot[bot],web-flow,cf-buildpacks-eng'
- name: Checkout
if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false'
uses: actions/checkout@v3
- name: Dispatch
if: steps.human-commits.outputs.human_commits == 'false' && steps.unverified-commits.outputs.unverified_commits == 'false'
uses: paketo-buildpacks/github-config/actions/dispatch@main
with:
repos: ${{ github.repository }}
token: ${{ secrets.CF_BOT_GITHUB_TOKEN }}
event: approve-bot-pr
payload: |
{
"number": "${{ github.event.pull_request.number }}",
"login": "${{ github.event.pull_request.user.login }}"
}