-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (40 loc) · 1.59 KB
/
exit-prerelease.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
name: Exit Prerelease Mode
on:
pull_request:
branches:
- main
jobs:
exit_prerelease:
name: Changesets Exit Prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
# Fetch entire git history so Changesets can generate changelogs
# with the correct commits
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "yarn"
cache-dependency-path: |
yarn.lock
# Check if pre.json file exists. The rest of the steps will only run if this file exists
- name: Check for pre.json file existence
id: check_files
uses: andstor/file-existence-action@v3.0.0
with:
files: ".changeset/pre.json"
# Exit prerelease mode
- name: Exit prerelease mode
if: steps.check_files.outputs.files_exists == 'true'
run: yarn changesets pre exit
- uses: stefanzweifel/git-auto-commit-action@v5
if: steps.check_files.outputs.files_exists == 'true'
with:
commit_message: Exit prerelease mode
# Commit these changes to the branch workflow is running against
branch: ${{ github.event.pull_request.head.ref }}