Skip to content

ci: run workflows in release PR (#40) #33

ci: run workflows in release PR (#40)

ci: run workflows in release PR (#40) #33

Workflow file for this run

name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions: {}
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.repository, 'StyleShit/')
permissions:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: 20.x
- run: npm ci
- name: Config git user
env:
# See https://github.com/actions/checkout/blob/85e6279cec87321a52edac9c87bce653a07cf6c2/README.md#push-a-commit-using-the-built-in-token
INPUT_USER: 'github-actions[bot]'
INPUT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
INPUT_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
run: |
git config --global user.name "${{ env.INPUT_USER }}"
git config --global user.email "${{ env.INPUT_EMAIL }}"
echo "GIT_USER=${{ env.INPUT_USER }}:${{ env.INPUT_TOKEN }}" >> $GITHUB_ENV
- name: Create release PR or publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
commit: 'chore(release): publish'
title: 'chore(release): publish'
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}