Skip to content

Commit 4a9ef35

Browse files
vahid-ahmadiclaude
andauthored
Fix invalid secrets reference in versioning workflow (#1531)
Secrets cannot be used directly in step-level `if` expressions in GitHub Actions. Use an env var with a shell conditional instead. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6fdf59b commit 4a9ef35

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/versioning.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ jobs:
7979
password: ${{ secrets.PYPI }}
8080
skip_existing: true
8181
- name: Update API
82-
if: ${{ secrets.POLICYENGINE_GITHUB != '' }}
83-
run: python .github/update_api.py
82+
run: |
83+
if [ -n "$CROSS_REPO_TOKEN" ]; then
84+
GITHUB_TOKEN="$CROSS_REPO_TOKEN" python .github/update_api.py
85+
else
86+
echo "Skipping cross-repo API update (POLICYENGINE_GITHUB secret not set)"
87+
fi
8488
env:
85-
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
89+
CROSS_REPO_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed invalid `secrets` reference in versioning workflow step condition that prevented the workflow from running.

0 commit comments

Comments
 (0)