Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default for GITHUB_TOKEN #25

Merged
merged 2 commits into from
Apr 3, 2020
Merged

Provide default for GITHUB_TOKEN #25

merged 2 commits into from
Apr 3, 2020

Conversation

chancancode
Copy link
Contributor

Copy link
Member

@thisismydesign thisismydesign left a comment

Choose a reason for hiding this comment

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

Thanks a lot, this is interesting. Do you know if this is the same token as secrets.GITHUB_TOKEN?

@gomorizsolt could you give both a try? Let's also make sure it's not possible to display this variable in the logs as it's not stored as a secret.

@chancancode
Copy link
Contributor Author

chancancode commented Apr 2, 2020

Yep see the documentation:

A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the GITHUB_TOKEN secret.

As for masking, yes, the masking on GitHub is value-based. If the value of the token is printed to the logs for any reason, and it doesn't matter how it got there, the processor of the logs will mask the value before rendering it, including in the "raw" logs.

So for example, you could take a secret value, pass it as an environment variable, feed it into a node script, then console.log it, and it will still be masked, even though GitHub has no hope of possibly tracing that console.log back to the source. However, if you do things like reversing the string, or splitting it and rejoining with spaces in between each character, then the masking would fail.

@thisismydesign
Copy link
Member

Thanks, that makes sense.

Copy link
Collaborator

@gomorizsolt gomorizsolt left a comment

Choose a reason for hiding this comment

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

Sorry for the sluggish reply. Thanks @chancancode for this improvement. I've tested your branch out against my experimental repository and works as expected. Approved from my side.

Copy link
Collaborator

@gomorizsolt gomorizsolt left a comment

Choose a reason for hiding this comment

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

One more thing: @chancancode, could you please update the doc accordingly? Just remove these lines:

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Note: secrets.GITHUB_TOKEN is a repository-level access token already provided by the Actions framework, you don't need to set any secrets.

Since it is set by default, it should be rare to have to customize it.
@chancancode
Copy link
Contributor Author

Done! 🆗

Copy link
Collaborator

@gomorizsolt gomorizsolt left a comment

Choose a reason for hiding this comment

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

Thanks!

@gomorizsolt gomorizsolt merged commit bd8893b into c-hive:master Apr 3, 2020
@gomorizsolt
Copy link
Collaborator

Released in https://github.com/c-hive/gha-remove-artifacts/releases/tag/v1.1.0. 🎉

@chancancode chancancode deleted the patch-1 branch April 3, 2020 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants