Skip to content

Commit 9fbdebf

Browse files
cameroncookecodex
andcommitted
fix(ci): Harden schema publish workflow
Limit the publish workflow token to read-only contents access and avoid interpolating the deploy key secret directly inside the shell guard. This keeps the workflow aligned with GitHub Actions security expectations and removes a brittle secret-handling pattern. Co-Authored-By: OpenAI Codex <noreply@openai.com>
1 parent 102658c commit 9fbdebf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/publish-schemas.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Publish Schemas
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: [main]
@@ -20,9 +23,11 @@ jobs:
2023
uses: actions/checkout@v4
2124

2225
- name: Fail if deploy key is missing
26+
env:
27+
DEPLOY_KEY: ${{ secrets.XCODEBUILDMCP_WEBSITE_DEPLOY_KEY }}
2328
run: |
2429
set -euo pipefail
25-
if [ -z "${{ secrets.XCODEBUILDMCP_WEBSITE_DEPLOY_KEY }}" ]; then
30+
if [ -z "$DEPLOY_KEY" ]; then
2631
echo "XCODEBUILDMCP_WEBSITE_DEPLOY_KEY is required to publish schemas." >&2
2732
exit 1
2833
fi

0 commit comments

Comments
 (0)