Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

ci: use crates api to get owner list #31348

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

yihau
Copy link
Contributor

@yihau yihau commented Apr 25, 2023

Problem

seems that we can't get CRATE_TOKEN correctly in a PR.

Summary of Changes

just use curl to get crates owner list

Screenshot 2023-04-26 at 8 18 18 AM

@yihau yihau force-pushed the specific-crate-token branch from a26509f to 5046625 Compare April 25, 2023 23:09
@yihau yihau force-pushed the specific-crate-token branch 2 times, most recently from c8f9a54 to d12bf84 Compare April 26, 2023 00:19
@yihau yihau changed the title ci: specify CRATE_TOKEN ci: use crates api to get owner list Apr 26, 2023
@yihau yihau marked this pull request as ready for review April 26, 2023 00:20
@yihau yihau added the automerge Merge this Pull Request automatically once CI passes label Apr 26, 2023
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@yihau yihau merged commit e79e138 into solana-labs:master Apr 26, 2023
@yihau yihau deleted the specific-crate-token branch April 26, 2023 00:36
result="$(cargo owner --list -q "$crate_name" --token "$CRATE_TOKEN" 2>&1)"
if [[ $result =~ ^error ]]; then
if [[ $result == *"Not Found"* ]]; then
response=$(curl -s https://crates.io/api/v1/crates/"$crate_name"/owners)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we'll be subject to lower api rate-limits without the token, so we need to keep an eye on that

@mergify
Copy link
Contributor

mergify bot commented Apr 26, 2023

automerge label removed due to a CI failure

@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Apr 26, 2023
@ryoqun
Copy link
Contributor

ryoqun commented Apr 28, 2023

seems that we can't get CRATE_TOKEN correctly in a PR.

(hi, i'm becoming a github action/workflow pro recently) well, this is expected. pr can't access to secretes as indicated below when kicked by on: pull_request. And there's no easy and safe workaround in github action itself (using crate's public api is decent idea):

image

@yihau
Copy link
Contributor Author

yihau commented Apr 28, 2023

yeah! thank you for the useful checking method!

I think they changed something (like fix or publish new features) cuz our PR works fine with the same method/flow earlier. (like this one https://github.com/solana-labs/solana/actions/runs/4778963531/jobs/8495728916 ) and iirc when I implemented this feature, we could still get the secret correctly if we didn't modify the yml. (sounds risky today though) it just break on that day 🤔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants