-
Notifications
You must be signed in to change notification settings - Fork 300
46 lines (42 loc) · 1.77 KB
/
version-packages.yml
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
# Description: this workflow creates or updates the "Version Packages" PR.
#
# Triggered by: whenever a commit is merged onto main and there are
# new changesets to consume.
name: Version Packages
on:
push:
branches: [main]
permissions:
contents: write # Used to commit to "Version Packages" PR
pull-requests: write # Used to create "Version Packages" PR
# Other permissions are defaulted to none
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Check if repo has unconsumed changesets
id: has-changesets
uses: ./.github/actions/has-changesets
- name: Setup Node.js 20
if: ${{ steps.has-changesets.outputs.has-changesets == 'true' }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 https://github.com/actions/setup-node/commit/60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 20
cache: 'yarn'
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Install packages
if: ${{ steps.has-changesets.outputs.has-changesets == 'true' }}
run: yarn --frozen-lockfile
- name: Create or update Version Packages PR
if: ${{ steps.has-changesets.outputs.has-changesets == 'true' }}
uses: changesets/action@b98cec97583b917ff1dc6179dd4d230d3e439894
with:
version: yarn bumpVersions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}