fix: update dependency @angular/compiler to v21.0.3 #1468
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
| # This workflow is used to augment the capabilities of the renovate GitHub app by updating the | |
| # formatting of all relevant files whenever the prettier dependency is updated. | |
| name: Renovate Update Formatting | |
| on: | |
| # NOTE: Never use pull_request_target here because that would populate secrets for forks | |
| # Renovate creates branches directly on the main repo and acts like a trusted contributor | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'pnpm-workspace.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| cancel-in-progress: true | |
| # Minimal permissions by default | |
| permissions: | |
| contents: read | |
| jobs: | |
| maybe_update_formatting: | |
| # Only run if it was the renovate bot that triggered the workflow (otherwise we'll create a loop) | |
| if: contains('["renovate[bot]"]', github.actor) == true | |
| name: Update if required | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # To allow us to perform the git diff we need the git history | |
| fetch-depth: 0 | |
| # To ensure we can push from a different user (and therefore cause actions to rerun) | |
| persist-credentials: false | |
| - name: Check if any relevant package was changed as part of the latest commit by renovate bot on the PR | |
| id: relevant-packages-check | |
| uses: ./.github/actions/check-package-changes | |
| with: | |
| packages: | | |
| prettier:.catalog["prettier"] | |
| - uses: pnpm/action-setup@v4 | |
| if: ${{ steps.relevant-packages-check.outputs.was-changed == 'true' }} | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Install Node.js per package.json | |
| if: ${{ steps.relevant-packages-check.outputs.was-changed == 'true' }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| # Use the volta.node property as the source of truth | |
| node-version-file: 'package.json' | |
| - name: Update formatting if any relevant package was changed and commit the changes | |
| if: ${{ steps.relevant-packages-check.outputs.was-changed == 'true' }} | |
| env: | |
| # We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions workflow runs, so we use a fine-grained PAT instead | |
| GITHUB_TOKEN: ${{ secrets.GH_FINE_GRAINED_PAT }} | |
| run: | | |
| # Checkout the PR branch using the github CLI | |
| gh pr checkout ${{ github.event.pull_request.number }} | |
| pnpm install --ignore-scripts | |
| # Reset any changes that happened before formatting (e.g. to the pnpm-workspace.yaml and lock file) so that we don't commit them | |
| git reset --hard | |
| # Update the formatting of all relevant files | |
| pnpm format | |
| # Commit all formatting changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this) | |
| git config --global user.email "james@henry.sc" | |
| git config --global user.name "JamesHenry" | |
| git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git | |
| # Check if there are any changes to commit after formatting | |
| if git diff --quiet; then | |
| echo "No formatting changes detected" | |
| else | |
| # Add everything that changed after the formatting | |
| git add --all | |
| git commit -m "chore: update formatting" | |
| git push | |
| fi |