|
| 1 | +name: 'Update E2E Lockfiles' |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every day at midnight UTC |
| 6 | + - cron: '0 0 * * *' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + sentry_only: |
| 10 | + description: 'Only update @sentry/* packages' |
| 11 | + type: boolean |
| 12 | + default: false |
| 13 | + workflow_call: |
| 14 | + inputs: |
| 15 | + sentry_only: |
| 16 | + description: 'Only update @sentry/* packages' |
| 17 | + type: boolean |
| 18 | + default: true |
| 19 | + |
| 20 | +env: |
| 21 | + CACHED_DEPENDENCY_PATHS: | |
| 22 | + ${{ github.workspace }}/node_modules |
| 23 | + ${{ github.workspace }}/packages/*/node_modules |
| 24 | + ${{ github.workspace }}/dev-packages/*/node_modules |
| 25 | +
|
| 26 | +jobs: |
| 27 | + update-lockfiles: |
| 28 | + name: Update E2E Lockfiles |
| 29 | + runs-on: ubuntu-24.04 |
| 30 | + timeout-minutes: 60 |
| 31 | + permissions: |
| 32 | + pull-requests: write |
| 33 | + contents: write |
| 34 | + steps: |
| 35 | + - name: Check out develop branch |
| 36 | + uses: actions/checkout@v6 |
| 37 | + with: |
| 38 | + ref: develop |
| 39 | + |
| 40 | + - name: Set up Node |
| 41 | + uses: actions/setup-node@v6 |
| 42 | + with: |
| 43 | + node-version-file: 'package.json' |
| 44 | + |
| 45 | + - name: Set up pnpm |
| 46 | + uses: pnpm/action-setup@v4 |
| 47 | + with: |
| 48 | + version: 9.15.9 |
| 49 | + |
| 50 | + - name: Install Dependencies |
| 51 | + uses: ./.github/actions/install-dependencies |
| 52 | + |
| 53 | + - name: Build packages |
| 54 | + run: yarn build |
| 55 | + |
| 56 | + - name: Build tarballs |
| 57 | + run: yarn build:tarball |
| 58 | + |
| 59 | + - name: Get node version |
| 60 | + id: versions |
| 61 | + run: | |
| 62 | + echo "node=$(jq -r '.volta.node' package.json)" >> $GITHUB_OUTPUT |
| 63 | +
|
| 64 | + - name: Validate Verdaccio |
| 65 | + run: yarn test:validate |
| 66 | + working-directory: dev-packages/e2e-tests |
| 67 | + |
| 68 | + - name: Prepare Verdaccio |
| 69 | + run: yarn test:prepare |
| 70 | + working-directory: dev-packages/e2e-tests |
| 71 | + env: |
| 72 | + E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ steps.versions.outputs.node }} |
| 73 | + |
| 74 | + - name: Update lockfiles |
| 75 | + working-directory: dev-packages/e2e-tests |
| 76 | + run: | |
| 77 | + for dir in test-applications/*/; do |
| 78 | + if [ -f "$dir/package.json" ]; then |
| 79 | + echo "Updating: $dir" |
| 80 | + if [ "${{ inputs.sentry_only }}" = "true" ]; then |
| 81 | + (cd "$dir" && pnpm update "@sentry/*" --ignore-scripts) || echo "Failed: $dir" |
| 82 | + else |
| 83 | + # Update all dependencies (including transitives) to latest within allowed ranges |
| 84 | + # --no-save keeps package.json unchanged, only updates the lockfile |
| 85 | + (cd "$dir" && pnpm update --no-save --ignore-scripts) || echo "Failed: $dir" |
| 86 | + fi |
| 87 | + fi |
| 88 | + done |
| 89 | +
|
| 90 | + - name: Set PR metadata |
| 91 | + id: pr-meta |
| 92 | + run: | |
| 93 | + if [ "${{ inputs.sentry_only }}" = "true" ]; then |
| 94 | + echo "title=chore(e2e): Update @sentry/* in lockfiles" >> $GITHUB_OUTPUT |
| 95 | + echo "commit=chore(e2e): update @sentry/* in lockfiles" >> $GITHUB_OUTPUT |
| 96 | + echo "body=Automated update of @sentry/* packages in E2E test application lockfiles after release." >> $GITHUB_OUTPUT |
| 97 | + else |
| 98 | + echo "title=chore(e2e): Update pnpm lockfiles" >> $GITHUB_OUTPUT |
| 99 | + echo "commit=chore(e2e): update pnpm lockfiles" >> $GITHUB_OUTPUT |
| 100 | + echo "body=Automated daily update of E2E test application lockfiles." >> $GITHUB_OUTPUT |
| 101 | + fi |
| 102 | +
|
| 103 | + - name: Create Pull Request |
| 104 | + id: create-pr |
| 105 | + uses: peter-evans/create-pull-request@v7 |
| 106 | + with: |
| 107 | + branch: chore/update-e2e-lockfiles |
| 108 | + delete-branch: true |
| 109 | + title: ${{ steps.pr-meta.outputs.title }} |
| 110 | + body: | |
| 111 | + ${{ steps.pr-meta.outputs.body }} |
| 112 | +
|
| 113 | + This PR updates the `pnpm-lock.yaml` files in all E2E test applications. |
| 114 | + commit-message: ${{ steps.pr-meta.outputs.commit }} |
| 115 | + labels: | |
| 116 | + CI & Build |
| 117 | +
|
| 118 | + - name: Enable squash automerge for PR |
| 119 | + if: steps.create-pr.outputs.pull-request-number != '' |
| 120 | + run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}" |
| 121 | + env: |
| 122 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 123 | + |
| 124 | + - name: Auto approve PR |
| 125 | + if: steps.create-pr.outputs.pull-request-number != '' |
| 126 | + uses: hmarr/auto-approve-action@v4 |
| 127 | + with: |
| 128 | + pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} |
| 129 | + review-message: 'Auto approved automated PR' |
0 commit comments