chore(deps-dev): bump @types/node from 20.10.7 to 20.14.2 #416
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `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/ | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: {} | |
jobs: | |
check-dist: | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Generate token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.MY_APP_ID }} | |
private_key: ${{ secrets.MY_APP_PRIVATE_KEY }} | |
id: my_app | |
- name: Checkout on `pull_request` | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ steps.my_app.outputs.token }} | |
- name: Checkout on not `pull_request` | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: actions/checkout@v4 | |
- name: Set Node.js 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .tool-versions | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Rebuild the dist/ directory | |
run: | | |
npm run build | |
npm run package | |
- name: Configure git | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
- 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 | |
continue-on-error: true | |
# NOTE: src/ と dist/ が一致することを保証するため差分があれば commit する | |
- name: Commit and push dist/ in the case of `pull_request` event | |
if: ${{ github.event_name == 'pull_request' && steps.diff.outcome == 'failure' }} | |
run: | | |
git add dist/ | |
git commit --author=. -m '[github-action] Automatically update dist' | |
git push |