Skip to content

Daily Assertion Fetch #404

Daily Assertion Fetch

Daily Assertion Fetch #404

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