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

Pull-requests created by github api aren't triggering CI builds #8

Closed
emteknetnz opened this issue Aug 16, 2023 · 6 comments
Closed
Assignees
Labels

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Aug 16, 2023

e.g. gha-update-js run silverstripe/silverstripe-mfa#505

There was no CI build automatically triggered

Likely the same issue seen in gha-merge-up where a CI build wasn't triggered after merging up a branch


Example workflow run - https://github.com/emteknetnz/silverstripe-tagfield/actions/runs/5885305010

Example PR created - https://github.com/emteknetnz/silverstripe-tagfield/pull/13

PRs

@emteknetnz emteknetnz changed the title Pull-requests created by github api aren't triggering CI build Pull-requests created by github api aren't triggering CI builds Aug 16, 2023
@emteknetnz emteknetnz self-assigned this Aug 16, 2023
@emteknetnz emteknetnz transferred this issue from silverstripe/gha-update-js Aug 16, 2023
@emteknetnz
Copy link
Member Author

emteknetnz commented Aug 16, 2023

Trigger using the GITHUB_TOKEN will prevent further actions from being triggered
peter-evans/create-pull-request#48 (comment)

It's an intentional design decision from github to prevent infinite loop situations
peter-evans/create-pull-request#48 (comment)

Not sure how to resolve this. Putting a PAT (personal-access-token) in every repo seems very undesirable. If it's possible to do an org wide PAT shared with every repo that's a possibility

In gha-merge-up we can just use the API to manually trigger a new build on the branch. However in this situation it's for pull-requests .. so you'd need to get the API to trigger a build for a pull-request? I don't think that's possible

@emteknetnz
Copy link
Member Author

On this pull-request silverstripe/silverstripe-totp-authenticator#132 - Using the UI I manually triggering a CI build against the pull-request branch https://github.com/silverstripe/silverstripe-totp-authenticator/actions/runs/5884330658 - however the builds don't show up automatically above the merge button

Possibly we could add in a link to the CI build with some all caps text saying CHECK CI BUILD HERE BEFORE MERGING and some more text explaining why the workaround exists

@emteknetnz
Copy link
Member Author

On this pull-request silverstripe/silverstripe-tagfield#254 - I closed it first, then started the CI build and then re-opened the pull-requests - this time builds did show up automatically

While this is good, in this context however both the pull-request and the CI is created using API calls so there's no guarantee about which ordered they'll get created, meaning that probably sometimes the builds would show and other times they wouldn't

@emteknetnz
Copy link
Member Author

I did a third test on this pull-request silverstripe/silverstripe-login-forms#150 - I manually triggered the ci build, then I closed and re-opened the pull-request. The builds showed up automatically. This implies we can provide instructions on the pull-request to close and re-open the pull-request to get the builds to show

@GuySartorelli
Copy link
Member

GuySartorelli commented Aug 17, 2023

Reassigned to @emteknetnz to check (if there's an easy way to do so) that the merged PRs have resolved the problem.
Note that while gha-pull-requests got its patch tag, the v1 tag hasn't been automatically updated so you'll need to do that first. I left that undone so you could see it for the sake of the message I just put in slack.

@emteknetnz
Copy link
Member Author

Have manually updated the v1 tag. Going forward this should be solved by silverstripe/.github#94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants