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

Builds from forks aren't manually triggered #130

Open
pl4nty opened this issue Feb 9, 2022 · 2 comments
Open

Builds from forks aren't manually triggered #130

pl4nty opened this issue Feb 9, 2022 · 2 comments

Comments

@pl4nty
Copy link
Owner

pl4nty commented Feb 9, 2022

Turns out pull_request_target runs automatically, even if "approve workflow runs from forks" is on... So build is skipped without the label, then can't be triggered without another commit.

Along with the move to paid SWA, we could look at using OIDC identities instead of secrets - https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure

This should remove the _target dependency, and we could ditch the label to just use the native approval system


(Edit by @jthvai)

pull_request_target is required to use secrets.

@CraftyDH
Copy link
Collaborator

CraftyDH commented Feb 9, 2022

In the github actions script it appears that there are 3 valid conditions for the job to be run.

As shown here (.github/workflows/build_and_deploy.yml)

# if not a PR, or an internal PR, or PR has 'safe to test' label
if: github.event_name != 'pull_request_target' || github.event.pull_request.head.repo.full_name == github.repository || contains(github.event.pull_request.labels.*.name, 'safe to test')

Therefore only builds from this repo or with the safe to test label will run.

A likely fix would just remove the if condition so it will run the test for all PR.

@pl4nty
Copy link
Owner Author

pl4nty commented Feb 10, 2022

@CraftyDH PRs access secrets for staging deployment, so we need some sort of approval to prevent secret exfiltration. The goal was "label PR > hit approve button", but turns out the approve button doesn't show

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

No branches or pull requests

2 participants