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

Add a workflow to automatically convert pull requests to draft #6460

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

BlackYps
Copy link
Contributor

@BlackYps BlackYps commented Sep 24, 2024

First of possibly many workflows to help us automate project management

@github-actions github-actions bot marked this pull request as draft September 24, 2024 10:39
@BlackYps BlackYps marked this pull request as ready for review September 24, 2024 10:41
@BlackYps BlackYps requested a review from Garanas September 24, 2024 10:41
@Garanas
Copy link
Member

Garanas commented Sep 24, 2024

I am missing the bigger picture here. What does this solve exactly?

@BlackYps
Copy link
Contributor Author

It's solving the problem that I want PRs to be drafts when they are not ready for review because the person that opened it still wants to implement additional things. People will forget to do this, because in the repo settings we can not set PRs to be drafts by default. So I added this action to do it for us.

It's not the most important thing, but it was easier than the manipulations of the project status that I have in mind to automate the milestone overview. I picked this to get familiar with automatic workflows that use github cli and are triggered by events. I should probably describe that in detail in an issue, so someone else can pick the further automations up.

@Garanas
Copy link
Member

Garanas commented Sep 25, 2024

I see, but the downside is that not all pull requests are necessarily unfinished. But there are pros/cons to everything, haha.

@@ -0,0 +1,14 @@
name: Convert PRs to Draft on Opening
Copy link
Member

@Garanas Garanas Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this repository has no global license I would add the standard MIT license at the top of the file, see also the other workflows that have this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a bit unelegant to specify this on the file level, but until we have a better solution I will do this.

@BlackYps
Copy link
Contributor Author

Luckily it's just a click of a button when the pull request is ready to be reviewed

@Garanas
Copy link
Member

Garanas commented Sep 25, 2024

I agree, I can see the value. At a minimum it will help to identify what contributions are ready to be reviewed.

@BlackYps BlackYps merged commit 37654d4 into develop Sep 25, 2024
3 checks passed
@BlackYps BlackYps deleted the draft-automation branch September 25, 2024 15:54
@Garanas
Copy link
Member

Garanas commented Nov 10, 2024

@BlackYps I think this approach does not work when a pull request originates from a fork.

image

See also an error message:

Run gh pr ready --undo 6518
API call failed: GraphQL: Resource not accessible by integration (convertPullRequestToDraft)
Error: Process completed with exit code 1.

Shall I disable the workflow for now?

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

Successfully merging this pull request may close these issues.

2 participants