Skip to content

Commit ac75201

Browse files
committed
Download schema with curl, move checkout step to after download
1 parent d0a9e94 commit ac75201

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Diff for: .github/workflows/update_types.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,32 @@ jobs:
1010
name: Check Saleor release and update types
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
15-
1613
- name: Get latest release info
1714
id: release
1815
run: |
1916
echo "Fetching latest release info..."
20-
latest_release=$(curl -s https://api.github.com/repos/saleor/saleor/releases/latest)
17+
latest_release=$(curl -s https://api.github.com/repos/saleor/saleor/releases/124548972)
2118
echo "tag=$(echo $latest_release | jq -r '.tag_name')" >> "$GITHUB_OUTPUT"
19+
echo "schema_url=$(echo $latest_release | jq -r '.assets[] | select(.name == "schema.graphql") | .url')" >> "$GITHUB_OUTPUT"
2220
echo "has_schema=$(echo $latest_release | jq -e '.assets[] | select(.name == "schema.graphql") | length > 0')" >> "$GITHUB_OUTPUT"
2321
2422
- name: Download schema.graphql
2523
run: |
2624
if [[ "${{ steps.release.outputs.has_schema }}" == "true" ]]; then
2725
echo "schema.graphql is attached to the ${{ steps.release.outputs.tag }} release, updating..."
26+
27+
curl --output schema.graphql \
28+
--url ${{ steps.release.outputs.schema_url }} \
29+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
30+
--header "Accept: application/octet-stream" \
31+
--location
2832
else
2933
echo "schema.graphql is not attached to the ${{ steps.release.outputs.tag }} release, exiting..."
3034
exit 1
3135
fi
3236
33-
- uses: robinraju/[email protected]
34-
with:
35-
repository: "saleor/saleor"
36-
latest: true
37-
fileName: "schema.graphql"
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
3839

3940
- name: Get PNPM version from package.json
4041
id: pnpm-version

0 commit comments

Comments
 (0)