-
Notifications
You must be signed in to change notification settings - Fork 10
💚 fix CI runs for fork PRs #240
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
Conversation
a29282d
to
e8890ac
Compare
fork PRs targeting main will never be able to pass integration tests or action-in-action due to the lack of permissions that fork action/workflow get: - it will not have write permission on the main repo - it will not have write permission on the wesleytodd/meeting-maker repo - it will not have write permission on its own repo because it's running in the main repo context therefore, if you want to see the integration tests and action-in-action test passing, then a PR needs to be created in the fork repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending the one question, this looks good.
const mainRepo = 'pkgjs/meet' | ||
|
||
function getTestRepo () { | ||
let testRepo = { owner: 'wesleytodd', repo: 'meeting-maker' } // ✨ Wes, the meeting maker ✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
|
||
testint: | ||
runs-on: ubuntu-latest | ||
# only run if not a fork PR targeting main repo due to permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw I am not sure this comment is any more clear than the code lol. Just to make sure I understand what you are saying here:
This checks to see if you are making a fork targeting your fork, not this repo?
If so, that seems like a reasonable middle ground to allow testing without leaking secrets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fork PR -> fork repo -> run test
fork PR -> main repo -> skip test
fork PRs targeting main will never be able to pass integration tests or action-in-action due to the lack of permissions that fork action/workflow get:
therefore, if you want to see the integration tests and action-in-action test passing, then a PR needs to be created in the fork repo
tests passing in the fork repo: ctcpip#25