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: Prebuild dependabot PRs | |
| on: | |
| pull_request: | |
| branches: main | |
| jobs: | |
| build: | |
| if: github.actor == 'dependabot[bot]' || github.actor == 'rviscomi' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run build script | |
| run: npm run build | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| if ! git diff --quiet; then | |
| echo "Changes detected, committing build artifacts..." | |
| git add . | |
| git commit -m "chore: Update build artifacts" -m "Generated by GitHub Actions for Dependabot PR" | |
| git push origin ${{ github.head_ref }} | |
| else | |
| echo "No changes to commit." | |
| fi |