Skip to content

Bump actions/upload-artifact from 4.5.0 to 4.6.0 in /.github/workflows #691

Bump actions/upload-artifact from 4.5.0 to 4.6.0 in /.github/workflows

Bump actions/upload-artifact from 4.5.0 to 4.6.0 in /.github/workflows #691

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set Node.js 16.x
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 16.x
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
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 "[email protected]"
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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/