diff --git a/.github/workflows/update-syft-release.yml b/.github/workflows/update-syft-release.yml index 18adfd5b..7c955bfd 100644 --- a/.github/workflows/update-syft-release.yml +++ b/.github/workflows/update-syft-release.yml @@ -13,14 +13,17 @@ jobs: if: github.repository == 'anchore/sbom-action' steps: - uses: actions/checkout@v3 - - run: | - LATEST_VERSION=$(curl -H "Accept: application/json" -H "Authorization: Bearer ${{ github.token }}" "https://api.github.com/repos/anchore/syft/releases/latest" 2>/dev/null | jq -r '.tag_name') + - name: Get latest Syft version + id: latest-version + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + LATEST_VERSION=$(gh release view --json name -q '.name' -R anchore/syft) echo "export const VERSION = \"$LATEST_VERSION\";" > src/SyftVersion.ts # install husky hooks and dependencies: npm install # export the version for use with create-pull-request: echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_OUTPUT - id: latest-version - uses: tibdex/github-app-token@v1 id: generate-token with: