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

Merging of pull requests created by GitHub-actions can't be done #71

Closed
jacobcook1995 opened this issue Sep 5, 2022 · 1 comment · Fixed by #73
Closed

Merging of pull requests created by GitHub-actions can't be done #71

jacobcook1995 opened this issue Sep 5, 2022 · 1 comment · Fixed by #73
Labels
bug Something isn't working

Comments

@jacobcook1995
Copy link
Collaborator

Describe the bug
Pull requests that are automatically created by GitHub actions cannot be merged, because some of the checks either do not run or fail to report back to the pull request (e.g. #70). This issue appears to be fairly common see.

To Reproduce
Steps to reproduce the behavior:

  1. Automatic update of pre-commit hooks is carried out in the early hours of Monday morning, this automatically creates a pull request
  2. If you go to this pull request you will see that the pre-commit.ci - pr task has passed, but the test tasks just show a message saying "Expected — Waiting for status to be reported"
  3. Pull request cannot be merged because "Required statuses must pass before merging"

Expected behavior
These tests should pass, allowing the pull request to be merged into develop.

Additional context
This issue seems to resolve itself when new GitHub actions are triggered by users, so one possible solution is pushing an empty commit to the branch, or closing and reopening the pull request. Alternatively, stack overflow suggests that by switching from using the default GITHUB_TOKEN to using a personal access token for this action this will allow the action to trigger other GitHub actions, which should fix the bug. However, while I have a PAT I'm not sure if it's sensible to be using my personal access token for this task? Or whether it is more appropriate to generate one for the bot to use (if that's possible)?

@jacobcook1995 jacobcook1995 added the bug Something isn't working label Sep 5, 2022
@dalonsoa
Copy link
Collaborator

dalonsoa commented Sep 6, 2022

Actually, I've just realised that the pre-commit action is no longer needed: I enabled the pre-commit-ci bot that deals with that automatically and - as you can see in #72 - runs all checks as any normal PR. This bot is enabled at Imperial organisation level - although it needs to be activated on each repo that requires it. Details of how to customise this action can be found in pre-commit.ci

In summary, what you point out is indeed a problem in general, but in our particular case it can be sorted out simply by removing the pre-commit workflow altogether (this file https://github.com/ImperialCollegeLondon/virtual_rainforest/blob/develop/.github/workflows/pre-commit_autoupdate.yml) and letting the pre-commit bot to do its job.

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