Bump the npm-development group with 2 updates #42
Workflow file for this run
This file contains hidden or 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
| name: Update dist on Dependabot PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: [main] | |
| jobs: | |
| build-and-commit: | |
| if: github.actor == 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.x | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: | | |
| npm run build | |
| npm run package | |
| - name: Commit dist changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add dist | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit." | |
| else | |
| git commit -m "Update dist after Dependabot update" | |
| git push | |
| fi | |
| - name: Trigger test workflow | |
| if: success() | |
| uses: peter-evans/repository-dispatch@v4 | |
| with: | |
| event-type: dependabot-dist-updated |