chore: update dependency prettier to v3.7.4 #2672
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 | |
| # e2e test snapshots when certain dependencies are updated. | |
| name: Renovate Update E2E Snapshots | |
| 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_e2e_tests: | |
| # 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: | | |
| eslint:.catalog["eslint"] | |
| @typescript-eslint/rule-tester:.catalogs.typescript-eslint["@typescript-eslint/rule-tester"] | |
| - 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 e2e snapshots if any relevant package was changed and commit the updated snapshots | |
| 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 }} | |
| SKIP_POSTINSTALL: 'true' | |
| run: | | |
| # Checkout the PR branch using the github CLI | |
| gh pr checkout ${{ github.event.pull_request.number }} | |
| # Run install and dedupe | |
| pnpm install --ignore-scripts | |
| pnpm dedupe | |
| # Build all packages | |
| pnpm build | |
| # Update the e2e test snapshots | |
| pnpm update-e2e-snapshots-ci --skip-nx-cache | |
| # Ensure all the changed files are formatted appropriately | |
| pnpm format | |
| # Commit all snapshot 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 | |
| # Only add snapshot files (other files may have been altered by the update, but we don't want to commit them) | |
| git add e2e/src/**/*.snap | |
| # Only commit and push if there are snapshot changes | |
| if git diff --cached --quiet; then | |
| echo "No snapshot changes to commit" | |
| else | |
| git commit -m "chore: update e2e test snapshots" | |
| git push | |
| fi |