Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Move action inputs from workflow file to configuration file #69

Closed
joao-paulo-parity opened this issue Mar 21, 2022 · 1 comment · Fixed by #74
Closed

Move action inputs from workflow file to configuration file #69

joao-paulo-parity opened this issue Mar 21, 2022 · 1 comment · Fixed by #74
Assignees
Labels
enhancement New feature or request

Comments

@joao-paulo-parity
Copy link
Contributor

joao-paulo-parity commented Mar 21, 2022

Problem: GitHub does not provide a $WORKFLOW_PATH for us to enforce that the workflow is triggered from a protected location (related to built-in checks. According to https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables:

If the workflow file doesn't specify a name, the value of this variable is the full path of the workflow file in the repository.

However:

  1. We do want to specify a readable name for the workflow since its commit status is created from this name
  2. It is wasteful to fetch both the configuration and workflow files, for the sake of protecting the latter, when we can simply get most inputs from the configuration file, thus only needing one request
  3. Even if the workflow's location can be protected, it's not easy to guarantee that there won't be multiple workflows using this same action in the same repository

Solution: since we're using a configuration file, the action inputs defined in https://github.com/paritytech/pr-custom-review/blob/master/action.yml, except the token, can be moved to that instead of passing them through the workflow's job inputs. Doing so would allow us to protect the inputs without having to put locks above team names.

@joao-paulo-parity joao-paulo-parity added the enhancement New feature or request label Mar 21, 2022
@joao-paulo-parity joao-paulo-parity changed the title Move action inputs workflow file to configuration file Move action inputs from workflow file to configuration file Mar 21, 2022
This was referenced Mar 31, 2022
@joao-paulo-parity joao-paulo-parity self-assigned this Apr 4, 2022
@joao-paulo-parity
Copy link
Contributor Author

The relevant GitHub ticket for the desired, but not yet implemented WORKFLOW_PATH, is community/community#4188

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

Successfully merging a pull request may close this issue.

1 participant