Skip to content

Commit

Permalink
Resolve short sha when checking out ctru-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-h-chamberlain committed Apr 21, 2024
1 parent dbebf24 commit 8385c3b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,25 @@ jobs:
with:
toolchain: ${{ matrix.toolchain }}

- name: Resolve inputs.ref to full SHA
# https://github.com/actions/checkout/issues/265#issuecomment-1936792528
id: resolve-ref
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ref=${{ matrix.ctru-rs-ref }}
sha=$(gh api /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 8385c3b

Please sign in to comment.