-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (35 loc) · 1.03 KB
/
normal.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
name: Normal tests
on:
pull_request:
merge_group:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
normal-test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Get the behavior from the PR description
id: get-behavior
uses: actions/github-script@v6
with:
result-encoding: string
script: |
let behavior = '{}';
if (context.payload.pull_request) {
const { body } = context.payload.pull_request;
const regex = /^\#normal-test:\s+(.*)$/m;
const result = regex.exec(body);
if (result) {
behavior = result[1];
}
}
console.log(behavior);
return behavior;
- name: run normal test
run: |
sleep ${{ fromJSON(steps.get-behavior.outputs.result).sleep || 15 }}
exit ${{ fromJSON(steps.get-behavior.outputs.result).exitCode || 0 }}