-
Notifications
You must be signed in to change notification settings - Fork 48
35 lines (35 loc) · 947 Bytes
/
test.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
on:
push:
branches:
- master
pull_request:
name: test
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.20.x
- uses: actions/checkout@v2
- run: go get -v -t ./...
- run: go test ./...
upload:
if: ${{ github.event_name == 'pull_request' }}
needs: [test]
runs-on: ubuntu-latest
# The PR number is uploaded instead of triggering another workflow directly
# because this workflow has no permissions and runs with the least
# privileges (This pipeline can be ran by PRs made from forks).
name: "Save PR number for Auto Approve workflow_run"
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr/