Skip to content

Bump @guardian/eslint-config-typescript from 9.0.1 to 10.0.1 #419

Bump @guardian/eslint-config-typescript from 9.0.1 to 10.0.1

Bump @guardian/eslint-config-typescript from 9.0.1 to 10.0.1 #419

name: Publish Beta Package
# This workflow is triggered on a label being added to a PR, and will publish a beta version of the bundle to npm
# Use `pnpm changeset add` to add a new change
# This action will release the changeset as a pre-release, and add a comment to the PR with the version number
on:
pull_request:
types: [labeled]
permissions: write-all
jobs:
has-permission:
name: Check permissions
runs-on: ubuntu-latest
steps:
- name: 'Check if user has admin access'
uses: 'lannonbr/repo-permission-check-action@2.0.2'
with:
permission: 'admin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: '@guardian/commercial'
runs-on: ubuntu-latest
needs: has-permission
if: github.event.label.name == '[beta] @guardian/commercial'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node
uses: ./.github/actions/setup-node-env
- name: Build package
run: pnpm build
- name: Version
run: pnpm changeset version --snapshot beta
- name: Create Release
uses: changesets/action@v1
id: changeset
with:
publish: pnpm changeset publish --tag beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const publishedPackages = ${{ steps.changeset.outputs.publishedPackages }};
const version = publishedPackages[0].version;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚀 ${version} published to npm as a beta release`
})