Skip to content

Commit

Permalink
update types workflow - download shema after checkout (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
2can authored Nov 23, 2023
1 parent b81f2b6 commit e508592
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/update_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ jobs:
echo "schema_url=$(echo $latest_release | jq -r '.assets[] | select(.name == "schema.graphql") | .url')" >> "$GITHUB_OUTPUT"
echo "has_schema=$(echo $latest_release | jq -e '.assets[] | select(.name == "schema.graphql") | length > 0')" >> "$GITHUB_OUTPUT"
- name: Download schema.graphql
- name: Check for schema.graphql in the latest Saleor release
run: |
if [[ "${{ steps.release.outputs.has_schema }}" == "true" ]]; then
echo "schema.graphql is attached to the ${{ steps.release.outputs.tag }} release, updating..."
curl --output schema.graphql \
--url ${{ steps.release.outputs.schema_url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header "Accept: application/octet-stream" \
--location
else
echo "schema.graphql is not attached to the ${{ steps.release.outputs.tag }} release, exiting..."
exit 1
Expand All @@ -37,6 +31,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download schema.graphql
run: |
curl --output schema.graphql \
--url ${{ steps.release.outputs.schema_url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header "Accept: application/octet-stream" \
--location
- name: Get PNPM version from package.json
id: pnpm-version
run: echo "pnpm_version=$(cat package.json | jq '.engines.pnpm' | sed -E 's/[^0-9.]//g')" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit e508592

Please sign in to comment.