Skip to content

Commit

Permalink
Always checkout JavaScript environment from main
Browse files Browse the repository at this point in the history
Workflows run from the workflow file on main, even when they
run on branches.  But just running "npm i" or a command like "npx"
that also installs packages uses the package.json file from
the branch.

Rather than attempt to keep the branch package files up-to-date
(which would _quadruple_ the number of update PRs, adding three
branch update PRs for every dependabot PR), let's just checkout
the package.json from main whenver we run.  The other workflows
only run on main - these two are the ones that run on branches.
  • Loading branch information
handrews committed Feb 7, 2024
1 parent 1de526f commit c0e8032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/schema-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'
- name: Install dependencies
run: npm i
- name: Install dependencies from main
run: |
git checkout main -- package.json
npm i
- name: Run tests
run: npm run test

2 changes: 2 additions & 0 deletions .github/workflows/validate-markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v2 # checkout repo content
- name: use the javascript environment from main
run: git checkout main -- package.json
- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '14.x'
Expand Down

0 comments on commit c0e8032

Please sign in to comment.