Skip to content

Commit

Permalink
Resolve short sha when checking out ctru-rs
Browse files Browse the repository at this point in the history
The devkitarm container doesn't have `gh` so we just make a raw API query,
and because the repo is public we don't need a token.
  • Loading branch information
ian-h-chamberlain committed Apr 21, 2024
1 parent dbebf24 commit 59851fd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,26 @@ jobs:
with:
toolchain: ${{ matrix.toolchain }}

- name: Resolve inputs.ref to full SHA
# https://github.com/actions/checkout/issues/265#issuecomment-1936792528
id: resolve-ref
run: |
apt-get update -y && apt-get install -y jq
ref=${{ matrix.ctru-rs-ref }}
sha=$(curl -L "https://api.github.com/repos/rust3ds/ctru-rs/commits/$ref" | jq -r .sha)
if [ -z "$sha" ]; then
echo "Failed to resolve ref $ref (possibly missing GH_TOKEN env var?)" >&2
exit 1
fi
echo "sha=$sha" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
repository: 'rust3ds/ctru-rs'
path: 'ctru-rs'
ref: ${{ matrix.ctru-rs-ref }}
ref: ${{ steps.resolve-ref.outputs.sha }}

- name: Build and run tests (unit + integration)
uses: ./run-tests
Expand Down

0 comments on commit 59851fd

Please sign in to comment.