-
Notifications
You must be signed in to change notification settings - Fork 48
105 lines (105 loc) · 3.03 KB
/
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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
on:
- push
name: Test
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
readmeExample:
name: "[TEST] README example"
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- name: Get latest release of ${{ github.repository }}
uses: ./
id: get_latest_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: GET /repos/{owner}/{repo}/releases/latest
owner: octokit
repo: request-action
- run: >-
echo latest release: '${{
fromJson(steps.get_latest_release.outputs.data).tag_name }}'
- name: Create check run for ${{ github.sha }}
uses: ./
id: create_check_run
with:
route: POST /repos/{owner}/{repo}/check-runs
owner: octokit
repo: request-action
name: Test check run
head_sha: ${{ github.sha }}
output: |
title: Test check run title
summary: A summary of the test check run
images:
- alt: Test image
image_url: https://octodex.github.com/images/jetpacktocat.png
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: >-
Update check run ${{ fromJson(steps.create_check_run.outputs.data).id
}}
uses: ./
id: update_check_run
with:
route: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}
owner: octokit
repo: request-action
check_run_id: ${{ fromJson(steps.create_check_run.outputs.data).id }}
conclusion: success
status: completed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Handle error
continue-on-error: true
uses: ./
id: get_release
with:
route: GET /repos/{owner}/{repo}/releases/v0.9.9
owner: octokit
repo: request-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: >-
echo Release cound not be found. Request failed with status ${{
steps.get_release.outputs.status }}
if: ${{ failure() }}
issues:
name: "[TEST] Issues"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- name: >-
Un-encode {repo} URL parameter when it's set to github.repository
(#71)
uses: ./
with:
route: GET /repos/{repository}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}