-
Notifications
You must be signed in to change notification settings - Fork 19
58 lines (55 loc) · 2.42 KB
/
assertionscsv-update.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
name: Daily Assertion Fetch
on:
schedule:
- cron: "00 00 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job to push the assertions
sync-assertioncsv:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install dependencies
run: lerna bootstrap --no-ci
- name: Fetch updated assertions.csv
run: |
cd ./packages/assertions
wget https://raw.githubusercontent.com/w3c/wot-thing-description/main/testing/assertions.csv --output-document=assertions-csv/assertions.csv
- name: Check for changes
continue-on-error: true
run: |
cd ./packages/assertions
git diff --exit-code assertions-csv/assertions.csv
echo "::set-output name=changed::$?"
id: diff
- name: Run generation scripts
if: ${{ ! steps.diff.outputs.changed }}
run: |
cd ./packages/assertions
bash generate-manual-csv.sh
- name: Add generated files and commit
if: ${{ ! steps.diff.outputs.changed }}
run: |
git config user.name 'Fady Salama'
git config user.email 'fadytawfik11@gmail.com'
git add -u
git commit -a -m "chore: sync assertions.csv with the current assertions in the spec and generate manual.csv"
- name: Create Pull Request
if: ${{ ! steps.diff.outputs.changed }}
id: cpr
uses: peter-evans/create-pull-request@v4
with:
branch: assertion-csv-sync
delete-branch: true
title: "Update assertions.csv and generate manual.csv"
body: |
Update assertions.csv and generate manual.csv
- Updated with *today's* date
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request