Skip to content

Commit

Permalink
Fix registry authentication (#4)
Browse files Browse the repository at this point in the history
Fixes the Shipyard.rs registry authentication by explicitly setting the
global credential provider to `cargo:token` instead of it being empty.
It also adds running `cargo check` to the integration test as it will
actually download the crates instead of just the index.
  • Loading branch information
akrantz01 committed Dec 11, 2023
1 parent b9cc5d4 commit 095b326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ jobs:
token: ${{ secrets.SHIPYARD_TOKEN }}
toolchain: ${{ matrix.rust }}

- run: cargo init . --bin --name CI
- run: cargo init . --bin --name ci
- run: cargo add logging --registry ${{ matrix.registry }}
- run: cargo check
4 changes: 1 addition & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ runs:
- name: Set Cargo environment variables
shell: bash
run: |
registry=$(tr '[:lower:]' '[:upper:]' <<< ${{ inputs.registry }})
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV
echo "CARGO_REGISTRIES_${registry}_TOKEN=${{ inputs.token }}" >> $GITHUB_ENV
echo "CARGO_REGISTRIES_${registry}_CREDENTIAL_HELPER=cargo:token" >> $GITHUB_ENV
echo "CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS=cargo:token" >> $GITHUB_ENV

0 comments on commit 095b326

Please sign in to comment.