-
Notifications
You must be signed in to change notification settings - Fork 13
54 lines (53 loc) · 1.5 KB
/
check-url.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
name: "tests check-url"
on:
pull_request:
push:
branches:
- main
jobs:
# test action works running from the graph
action:
name: Test check-url
runs-on: ubuntu-latest
steps:
- name: Checkout Locally
uses: actions/checkout@v4
- name: checks https://beta.gouv.fr/stats
uses: ./check-url
with:
url: https://beta.gouv.fr/stats
output: stats.json
- name: test output
run: |
echo $(cat stats.json)
grade=$(echo $(cat stats.json | jq '.grade'))
echo "grade=$grade"
if [[ -z "$grade" || "$grade" != "\"A\"" ]]; then
exit 1
fi
- name: checks https://beta.gouv.fr/invalid
uses: ./check-url
with:
url: https://beta.gouv.fr/invalid
output: stats3.json
- name: test output
run: |
echo $(cat stats3.json)
grade=$(echo $(cat stats3.json | jq '.grade'))
echo "grade=$grade"
if [[ -z "$grade" || "$grade" != "\"F\"" ]]; then
exit 1
fi
- name: checks https://mon-entreprise.urssaf.fr/stats
uses: ./check-url
with:
url: https://mon-entreprise.urssaf.fr/stats
output: stats2.json
- name: test output
run: |
echo $(cat stats2.json)
grade=$(echo $(cat stats2.json | jq '.grade'))
echo "grade=$grade"
if [[ -z "$grade" || "$grade" != "\"A\"" ]]; then
exit 1
fi