Skip to content

Commit a745ae2

Browse files
sserrataclaude
andcommitted
ci: consolidate canary publishing into release.yaml for OIDC compatibility
npm trusted publishing only supports one trusted publisher entry per package, so canary and release must share the same workflow file. - Move canary publish job into release.yaml as a second job - Add packages-changed check via git diff to replicate the paths filter behavior from the old canary-release.yml - Delete canary-release.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 48481cc commit a745ae2

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

.github/workflows/canary-release.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,41 @@ jobs:
3333
run: npx ts-node --transpile-only scripts/publish.ts
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
canary:
38+
name: Publish Canary
39+
runs-on: ubuntu-latest
40+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && github.ref == 'refs/heads/main' }}
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
44+
with:
45+
fetch-depth: 0
46+
- name: Check if packages changed
47+
id: packages_changed
48+
run: |
49+
if git diff --name-only HEAD~1 HEAD | grep -q "^packages/"; then
50+
echo "changed=true" >> $GITHUB_OUTPUT
51+
else
52+
echo "changed=false" >> $GITHUB_OUTPUT
53+
fi
54+
- name: Set up Node
55+
if: steps.packages_changed.outputs.changed == 'true'
56+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
57+
with:
58+
node-version: "22"
59+
registry-url: "https://registry.npmjs.org"
60+
cache: yarn
61+
- name: Prepare git
62+
if: steps.packages_changed.outputs.changed == 'true'
63+
run: |
64+
git config --global user.name "github-actions[bot]"
65+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
66+
git fetch
67+
git checkout main
68+
- name: Installation
69+
if: steps.packages_changed.outputs.changed == 'true'
70+
run: yarn && yarn build-packages
71+
- name: Publish Canary release
72+
if: steps.packages_changed.outputs.changed == 'true'
73+
run: yarn canary

0 commit comments

Comments
 (0)