Bump web-vitals from 3.3.2 to 3.4.0 in /src #384
Workflow file for this run
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
###################################### | |
## Custom Web Almanac GitHub action ## | |
###################################### | |
# | |
# This Action generates the dynamic templates. It also then takes a copy | |
# of the templates folder, and then checks out main branch and regenerates the | |
# templates and compares the two. If run from a pull request it adds a comment | |
# showing the diffs. | |
# | |
# Note it does not run a full test of the website as that will be completed by | |
# the test_website.yml GitHub Action. | |
# | |
# This Action is useful to check impact of dependency upgrades (e.g. if | |
# prettier version change results in different HTML being generated), since we | |
# do not store generated templates in Git and so cannot otherwise see these | |
# changes. Changes can then be accepted or investigated further before merging. | |
# | |
name: Test Template Changes | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '**/package.json' | |
- '**/package-lock.json' | |
jobs: | |
build: | |
name: Build and Test Template Changes | |
runs-on: ubuntu-20.04 | |
if: github.repository == 'HTTPArchive/almanac.httparchive.org' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js for use with actions | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Test Template Changes | |
run: ./src/tools/scripts/test_template_changes.sh | |
- name: 'Comment PR' | |
uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' && env.PR_COMMENT != '' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# yamllint disable rule:line-length | |
script: | | |
const { issue: { number: issue_number }, repo: { owner, repo } } = context; | |
// Unescape any escaped comments so code blocks appear correctly | |
const pr_comment = process.env.PR_COMMENT.replace(/%0A/g,'\n').replace(/%0D/g,'\r').replace(/%27/g,"'").replace(/%22/g,'"').replace(/%25/g,'%'); | |
github.rest.issues.createComment({ issue_number, owner, repo, body: pr_comment }); |