-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (46 loc) · 1.25 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
name: Test
on:
pull_request:
branches:
- '**'
- '!main'
push:
branches:
- '**'
- '!main'
jobs:
test:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
- run: npm test
env:
GITHUB_REPOSITORY: zentered/issue-forms-body-parser-test
- run: npm run build
- name: Read an issue content
id: read_issue
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
cat ./test/test-issue-3.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Issue Forms Body Parser With Provided Body
id: parse_with_body
uses: ./
with:
body: ${{ steps.read_issue.outputs.body }}
- name: Test input body parsed
run: |
expected="Event Description"
title=$(echo ${{ toJSON(steps.parse_with_body.outputs.data) }} | jq -r '.["event-description"].title')
if [[ $title != $expected ]]; then
echo "Title \"${title}\" does not match \"${expected}\""
exit 1
fi