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