Only run install and build when needed #1878
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: Run build for renovate PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| check: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| javascript: ${{ steps.filter.outputs.javascript }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Check for changes | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: filter | |
| with: | |
| filters: | | |
| javascript: | |
| - 'package.json' | |
| - 'yarn.lock' | |
| build: | |
| if: ${{ github.actor == 'renovate[bot]' && needs.check.outputs.javascript == 'true' }} | |
| runs-on: ubuntu-24.04 | |
| needs: check | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.COMMIT_PAT }} | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: 24.14.0 # renovate: datasource=node depName=node | |
| - name: Install dependencies | |
| run: corepack yarn install | |
| - name: Run build | |
| run: corepack yarn build | |
| - name: Commit changes | |
| id: commit | |
| uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0 | |
| with: | |
| commit_message: 'Update dist/ after build' |