Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint, Build & Test"
name: "PR checks"

on: [push, pull_request]

Expand Down Expand Up @@ -30,10 +30,38 @@ jobs:
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: JavaScript files are not up to date. Run 'npm run-script build' to update"
git status
exit 1
fi
echo "Success: JavaScript files are up to date"

check-node-modules:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check node modules up to date
run: |
# Sanity check that repo is clean to start with
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then this workflow needs attention...
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi

# Reinstall modules and then clean to remove absolute paths
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
npm ci
npm run removeNPMAbsolutePaths
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have the --force flag?

The reason I added the --force flag to removeNPMAbsolutePaths is so that it rewrites all files to a canonical form. I was seeing some differences in ordering of properties of json objects when there were otherwise no changes. I hope by letting removeNPMAbsolutePaths decide this aspect we'll avoid any inconsistencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's a reference to the script defined in package.json

"removeNPMAbsolutePaths": "removeNPMAbsolutePaths . --force"

I did it that way so then we can keep things consistent by only specifying the arguments there.

It is perhaps a bit confusing that the name is the same, unless you know what is going on. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that. If it works I'm happy with it

# Check that repo is still clean
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci' and 'npm run removeNPMAbsolutePaths' to update"
git status
exit 1
fi
echo "Success: node_modules are up to date"

npm-test:
runs-on: ubuntu-latest

Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/removeNPMAbsolutePaths

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion node_modules/@actions/http-client/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions node_modules/@actions/http-client/RELEASES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions node_modules/@actions/http-client/auth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions node_modules/@actions/http-client/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading