-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (61 loc) · 2.24 KB
/
badges.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
name: "Update badges"
on:
pull_request:
push:
branches: [main]
jobs:
badge_2022:
name: 2022 Presidential election polls
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download jq
run: sudo apt-get update -y && sudo apt-get install -y jq
- name: Compute number of polls
run: echo "NUM_POLLS=$( jq -r '.sondages | keys[]' sondages/presidentielles_2022.json | wc -l)" >> $GITHUB_ENV
- name: Create the Badges
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 51a78df74e3aeaa07fe17c83eb0608fb
filename: 2022.json
message: ${{ env.NUM_POLLS }}
label: Présidentielles 2022
color: green
badge_2017:
name: 2017 Presidential election polls
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Download jq
run: sudo apt-get update -y && sudo apt-get install -y jq
- name: Compute number of polls
run: echo "NUM_POLLS=$( jq -r '.sondages | keys[]' sondages/presidentielles_2017.json | wc -l)" >> $GITHUB_ENV
- name: Create the Badges
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 51a78df74e3aeaa07fe17c83eb0608fb
filename: 2017.json
message: ${{ env.NUM_POLLS }}
label: Présidentielles 2017
color: green
badge_popularite:
name: Popularity
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Compute number of polls
run: echo "NUM_POLLS=$( tail -n +2 sondages/popularite.csv | wc -l )" >> $GITHUB_ENV
- name: Create the Badges
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 51a78df74e3aeaa07fe17c83eb0608fb
filename: popularity.json
message: ${{ env.NUM_POLLS }}
label: Popularité
color: green