generate codeartifact token in CI, allow non-appfolio members to yarn install #1287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub workflow secrets for public repos
A public repo's GitHub workflows should have NO access to secrets. Secrets can be seen here:
https://github.com/appfolio/<repo_name>/settings/secrets/actions.This is to prevent actors from pushing a branch with a workflow that extracts secrets.
Secrets can instead be accessed through repo environments: https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage-environments
Authorized teams must manually approve workflows that use environments before the workflow can proceed.
Essentially, we use environments to protect secrets from being accessed by unauthorized actors.
Why not use the "Require approval for all external contributors" setting in
https://github.com/appfolio/<remo_name>/settings/actions?We do set that but it is not clear if this applies to all PRs or just fork PRs. Additionally, any AppFolio member can approve workflows, increasing the chance of someone approving a workflow without reviewing the changes.
Using a private package registry for public repos
We do not want to expose our private registry URL or access keys for obvious reasons.
We can store these values in environment secrets and use them in protected workflows (see above).
Members of AppFolio should have these values locally, enabling local development.
Non-AppFolio contributors can use the public package registry with an opt-in flag. In the case of react-gears, it's this:
Workflows that do not require secrets can also use the above command and do not need to use an environment. The test/lint workflow in react-gears does this.