@@ -9,27 +9,30 @@ name: Release app
99on :
1010 workflow_dispatch :
1111 push :
12- branches : [ main, release/** ]
12+ branches : [main, release/**]
1313jobs :
1414 build :
1515 environment : release
16+ permissions :
17+ contents : write
1618 strategy :
1719 # Uncomment max-parallel to prevent race condition (where multiple releases are
1820 # created concurrently). Typically though, we'll create a release manually ahead of time
1921 # which prevents the race.
2022 # max-parallel: 1
2123 matrix :
2224 # See https://github.com/SFARPak/dyad/issues/96
23- os : [
25+ os :
26+ [
2427 { name: "windows", image: "windows-latest" },
2528 { name: "linux", image: "ubuntu-22.04" },
2629 { name: "macos-intel", image: "macos-13" },
2730 { name: "macos", image: "macos-latest" },
2831 ]
2932 runs-on : ${{ matrix.os.image }}
3033 # env:
31- # CSC_LINK: ${{ secrets.CSC_LINK }}
32- # CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
34+ # CSC_LINK: ${{ secrets.CSC_LINK }}
35+ # CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
3336 steps :
3437 - name : Github checkout
3538 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8184 # run: |
8285 # smctl windows certsync --keypair-alias=${{ secrets.DIGICERT_KEYPAIR_ALIAS }}
8386 # shell: bash
84- # Publish (all platforms)
87+ # Publish (all platforms)
8588 - name : Publish app
8689 env :
8790 NODE_OPTIONS : " --max-old-space-size=4096"
@@ -102,47 +105,8 @@ jobs:
102105 contents : read
103106 packages : read
104107 actions : read
108+ id-token : write
105109 steps :
106- - name : Check token permissions
107- run : |
108- echo "π Checking GITHUB_TOKEN permissions..."
109- echo "π‘ Making API call to: https://api.github.com/user"
110-
111- # Capture full response for detailed logging
112- RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}\n" \
113- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
114- -H "Accept: application/vnd.github.v3+json" \
115- -H "User-Agent: dyad-release-workflow" \
116- https://api.github.com/user)
117-
118- # Extract status code
119- HTTP_STATUS=$(echo "$RESPONSE" | grep "HTTP_STATUS:" | cut -d: -f2)
120- JSON_RESPONSE=$(echo "$RESPONSE" | sed '/HTTP_STATUS:/d')
121-
122- echo "π‘ API Response Status: $HTTP_STATUS"
123-
124- # Log token scopes and permissions from headers (if available)
125- echo "π Token scopes: $(curl -s -I \
126- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
127- -H "Accept: application/vnd.github.v3+json" \
128- https://api.github.com/user | grep -i "x-oauth-scopes:" | sed 's/.*: //' || echo "Not available")"
129-
130- echo "π Accepted permissions: $(curl -s -I \
131- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
132- -H "Accept: application/vnd.github.v3+json" \
133- https://api.github.com/user | grep -i "x-accepted-github-permissions:" | sed 's/.*: //' || echo "Not available")"
134-
135- if [ "$HTTP_STATUS" -eq 200 ]; then
136- echo "β
Token authentication successful"
137- echo "π€ User data:"
138- echo "$JSON_RESPONSE" | jq '.login // "Not available"'
139- echo "π Permissions:"
140- echo "$JSON_RESPONSE" | jq '.permissions // empty'
141- else
142- echo "β Token authentication failed with status: $HTTP_STATUS"
143- echo "π Response body: $JSON_RESPONSE"
144- exit 1
145- fi
146110 - name : Github checkout
147111 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
148112 - name : Use Node.js
0 commit comments