Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update types workflow - download shema after checkout #1036

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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