-
Notifications
You must be signed in to change notification settings - Fork 299
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@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
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 16
if: ${{ steps.has-changesets.outputs.has-changesets == 'true' }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 16
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 }}