Skip to content

Version Packages (#6236) #1768

Version Packages (#6236)

Version Packages (#6236) #1768

# 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 }}