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

Github Actions do not work on forked PR's #509

Closed
epheo opened this issue Apr 10, 2024 · 3 comments · Fixed by #512
Closed

Github Actions do not work on forked PR's #509

epheo opened this issue Apr 10, 2024 · 3 comments · Fixed by #512
Assignees
Labels
bug Something isn't working

Comments

@epheo
Copy link
Contributor

epheo commented Apr 10, 2024

As per the example from GitHub docs:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-run-job-for-specific-repository

It would be better to add a conditions in the Github actions workflows in order for them to run only on gopro/OpenGoPro and prevent them to run on forked repositories.

if: github.repository == 'gopro/OpenGoPro'
@epheo epheo added the enhancement New feature or request label Apr 10, 2024
@github-actions github-actions bot added the triage Needs to be reviewed and assigned label Apr 10, 2024
@tcamise-gpsw
Copy link
Collaborator

Hello. I finally have some time to go through all of the issues here. This is first on the priority list: to allow forked PR's. I'm starting today to review what the current state / problem is.

@tcamise-gpsw tcamise-gpsw added bug Something isn't working and removed enhancement New feature or request triage Needs to be reviewed and assigned labels Apr 10, 2024
@tcamise-gpsw tcamise-gpsw self-assigned this Apr 10, 2024
@tcamise-gpsw tcamise-gpsw changed the title Add conditions to Github Actions to avoid running workflows on forks Github Actions do not work on forked PR's Apr 10, 2024
@tcamise-gpsw
Copy link
Collaborator

I think I've found the root of the problem. Currently the copyright action runs on each PR update and updates the PR branch with missing copyrights. There is some strange GH Action behavior where actions will not get retriggered using the default GH token. Therefore I have been using a repository secret token. However this secret token is of course not exposed to forks.

I think the solution is to move the copyright action out of the PR check and into the "push to main" check. Of course all of the runners seem to be down right now so I can't test yet...

@tcamise-gpsw tcamise-gpsw linked a pull request Apr 10, 2024 that will close this issue
@tcamise-gpsw
Copy link
Collaborator

tcamise-gpsw commented Apr 10, 2024

I just tested on a fork I made and it seems to be working. I'm updating your PR's now to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants