Files
backstage/.github/workflows/sync_version-packages.yml
T
Fredrik Adelöw ebcc8b7ca9 ci: enable corepack in setup-node steps
The actions/setup-node@v6.4.0 upgrade stopped auto-shimming yarn onto
PATH via corepack. The yarn-plugin test spawns yarn via Node's
child_process.spawn() which does a raw PATH lookup, causing
ENOENT failures. Adding corepack: true ensures the yarn shim is
available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-28 10:20:37 +02:00

73 lines
2.3 KiB
YAML

name: Sync Version Packages PR
on:
push:
branches:
- master
concurrency:
group: sync-version-packages
cancel-in-progress: true
jobs:
create-release-pr:
name: Create Changeset PR
runs-on: ubuntu-latest
env:
CI: true
NODE_OPTIONS: --max-old-space-size=8192
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 20000
fetch-tags: true
token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
- name: Use Node.js 22.x
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.x
registry-url: https://registry.npmjs.org/ # Needed for auth
corepack: true
- name: Install Dependencies
run: yarn --immutable
- name: Create Release Pull Request
uses: backstage/changesets-action@a39baf18913e669734ffb00c2fd9900472cfa240 # v2.3.2
with:
# Calls out to `changeset version`, but also runs prettier
version: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
HUSKY: '0'
- name: Discord notification
if: ${{ failure() }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
script: |
const webhook = process.env.DISCORD_WEBHOOK;
if (!webhook) {
throw new Error('DISCORD_WEBHOOK secret is not set');
}
const repo = context.repo.owner + '/' + context.repo.repo;
const runId = context.runId;
const message = `Version Packages Sync Failed https://github.com/${repo}/actions/runs/${runId}`;
const response = await fetch(webhook, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ content: message }),
});
if (!response.ok) {
throw new Error(`Discord webhook request failed: ${response.status} ${response.statusText}`);
}