-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (45 loc) · 1.26 KB
/
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
name: PR Build and test
on: [pull_request]
permissions:
statuses: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
addHoldComment: "true"
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm run pack
- run: npm test
# If something fails I want to set the status commit to "error" without adding anymore comments
# I'm happy to leave the PR with `/hold` if there is an error
- if: always()
uses: ./
with:
addHoldComment: "true"
status: "${{ job.status }}"
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set final commit status
uses: actions/github-script@v7
if: always()
env:
GITHUB_TOKEN: ${{ github.token }}
with:
script: |
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.pull_request.head.sha,
state: 'success',
description: "🐛 testing utf emoji!",
context: 'test'
})