This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
2021-10-07 14:41:34 +00:00
|
|
|
name: Update Test Data
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# We don't want to update again on main
|
|
|
|
branches-ignore:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-test-data:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
# Helper for grabbing the branch name
|
|
|
|
- uses: nelonoel/branch-name@v1.0.1
|
|
|
|
- name: Use Node.js
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
|
|
|
|
# Install node modules for updatetestdata.js script
|
|
|
|
- name: Install Dependencies
|
2021-10-07 14:55:33 +00:00
|
|
|
run: |
|
|
|
|
npm install got
|
|
|
|
npm install prettier
|
2021-10-07 14:41:34 +00:00
|
|
|
|
|
|
|
# Generate the new test data for the Health Checks
|
|
|
|
- name: Generate test data
|
|
|
|
run: |
|
|
|
|
node packages/health-check/src/updatetestdata.js > packages/health-check/src/fixtures/testdata.json
|
2021-10-07 14:55:33 +00:00
|
|
|
npx prettier --write packages/health-check/src/fixtures/testdata.json
|
2021-10-07 14:41:34 +00:00
|
|
|
|
|
|
|
# Commit the Updates to the test data
|
|
|
|
- name: Update test data
|
|
|
|
uses: test-room-7/action-update-file@v1
|
|
|
|
with:
|
|
|
|
file-path: packages/health-check/src/fixtures/testdata.json
|
|
|
|
commit-msg: Update testdata from Github Actions
|
|
|
|
branch: ${{ env.BRANCH_NAME }}
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|