Skip to content

Prevent release workflow from running in forks (#4679) #27

Prevent release workflow from running in forks (#4679)

Prevent release workflow from running in forks (#4679) #27

Workflow file for this run

name: Release
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
id-token: write
pull-requests: write
jobs:
release:
name: Release
if: github.repository == 'mobxjs/mobx'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Setup Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Build packages
run: npm run build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1.9.0
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}