Skip to content

Bump actions/setup-node from 4.0.4 to 4.1.0 in /.github/workflows #653

Bump actions/setup-node from 4.0.4 to 4.1.0 in /.github/workflows

Bump actions/setup-node from 4.0.4 to 4.1.0 in /.github/workflows #653

Workflow file for this run

# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist folder contents
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
permissions:
contents: read
jobs:
check-dist:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set Node.js 16.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 16.x
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Rebuild the dist/ directory
run: |
npm run all
- name: Double check Actor
run: |
echo "Actor: ${{ github.actor }}"
- name: Update dist folder on Dependabot PR
if: ${{ github.actor == 'dependabot[bot]' }}
run: |
echo "Actor: ${{ github.actor }}"
if [[ $(git status --porcelain) ]]; then
echo "There are uncommitted changes in the dist/ directory."
git config --global user.email "depenbabot@github.com"
git config --global user.name "Dependabot"
git add dist/*
git commit -m "Update dist"
git push origin main
fi
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/