Daily Assertion Fetch #409
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Use lerna | |
run: npm install -g [email protected] | |
- 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 '[email protected]' | |
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 |