Repository navigation
59 lines (55 loc) · 1.93 KB
/
Copy pathversion.yml
File metadata and controls
59 lines (55 loc) · 1.93 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
name: Update release PR
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
on:
push:
branches: [main]
workflow_dispatch:
permissions: {}
jobs:
version:
name: Update release PR
if: github.repository_owner == 'convex' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24.22.1"
package-manager-cache: false
- run: npm ci --ignore-scripts
- name: Check whether a version PR is needed
id: mode
uses: changesets/action/select-mode@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
- name: Check main is still at this run's commit
if: steps.mode.outputs.mode == 'version'
id: freshness
env:
GH_TOKEN: ${{ github.token }}
run: |
main_sha="$(gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/main" --jq '.object.sha')"
if [[ "$main_sha" == "$GITHUB_SHA" ]]; then
echo "current=true" >> "$GITHUB_OUTPUT"
else
echo "current=false" >> "$GITHUB_OUTPUT"
echo "Skipping release PR update: main has moved beyond this run's commit."
fi
- name: Create or update the release PR
if:
steps.mode.outputs.mode == 'version' &&
steps.freshness.outputs.current == 'true'
uses: changesets/action/version@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
github-token: ${{ github.token }}
pr-title: "Prepare next release"
commit-message: "Version packages"
pr-base-branch: main