Skip to content

Commit

Permalink
[chore] call npm with ci instead of install (#11970)
Browse files Browse the repository at this point in the history
This is as recommended to address a warning about pinning npm install
documented in ossf/scorecard#4422

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Dec 21, 2024
1 parent 7c26397 commit a573bc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Render .chloggen changelog entries
run: make chlog-preview > changelog_preview.md
- name: Install markdown-link-check
run: npm install
run: npm ci
- name: Run markdown-link-check
run: |
npx --no -- markdown-link-check \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
- name: Get changed files
id: changes
run: |
files=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)
if [ -z "$files" ] && git diff --name-only $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep -q "package.json"; then
files="**/*.md"
fi
files=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)
echo "files=$files" >> $GITHUB_OUTPUT
if [ -z "$files" ] && git diff --name-only $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep -q "package.json"; then
files="**/*.md"
fi
echo "files=$files" >> $GITHUB_OUTPUT
check-links:
runs-on: ubuntu-latest
needs: changedfiles
Expand All @@ -47,12 +47,12 @@ jobs:
fetch-depth: 0

- name: Install markdown-link-check
run: npm install
run: npm ci

- name: Run markdown-link-check
run: |
npx --no -- markdown-link-check \
--verbose \
--config .github/workflows/check_links_config.json \
${{needs.changedfiles.outputs.files}} \
|| { echo "Check that anchor links are lowercase"; exit 1; }
|| { echo "Check that anchor links are lowercase"; exit 1; }

0 comments on commit a573bc9

Please sign in to comment.