-
Notifications
You must be signed in to change notification settings - Fork 30
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
New custom-logic
action input
#68
Conversation
Hi @aciceri, we've been discussing this issue internally and think it would be better solved by documentation about how to accomplish this, instead of building support for it in directly. We think that would ultimately better and more flexible for folks. Does that make sense to you? |
@grahamc am I missing something or this isn't accomplishable by using the action as is? At the beginning I've tried looking for a workaround that didn't require me to fork the action but I couldn't (can't remember details but my ideas were really ugly/convoluted, it was easier just rewriting the action). I remind you that I want to execute my custom logic before the PR is created/updated but after that the commit with the updated inputs is created. |
Correct, using only this action in its current state, it is not possible to do what you want. However, is there a reason why executing the custom logic after the PR is created/updated is unacceptable? I think it would be fairly simple to edit the PR description immediately after it has been submitted, and we could add an example in the README demonstrating that. Specifically, the create-pull-request action we use exposes the PR number of the created PR (as well as whether the operation that action took), and we re-expose that information. So I can imagine that it would be possible to utilize that with another GitHub Action that accepts a PR number or some other identifying information and change the PR body using that info. |
I did a bit of looking and found a couple actions that might be useful:
Another solution could be to use pr=68 # give the update-flake-lock step an id and use ${{ steps.<ID>.outputs.pull-request-number }} here
gh pr view "$pr" --json body --jq .body > body
cat >> body <<EOF
---
Here is some more stuff that I would like to add
EOF
gh pr edit "$pr" --body-file ./body
rm ./body or this: pr=68 # give the update-flake-lock step an id and use ${{ steps.<ID>.outputs.pull-request-number }} here
gh pr view "$pr" --json body --template \
'{{.body}}
---
Here is some more stuff that I would like to add' > body
gh pr edit "$pr" --body-file ./body
rm ./body |
Uh you are right, I couldn't think the simplest solution. The only difference is that this way there will be a time delta where the PR is created but I don't have a complete text body for it (in my case it takes about 40 minutes to build a new Emacs) but this isn't a problem for my use case. Said this I think you can close this, or, if you prefer, I can change this adding an example doing what you suggest (I believe that having diffs or other tasks like running Thanks :) |
I'm going to close this PR since it is pretty directionally different. If you're up for it, it'd be awesome for you to submit an example to the README. Thanks, @aciceri! |
…m DeterminateSystems/update-deps` (`3b8b6d7f42f7ad467dd6f769913ac162731507c6`)
Description
I've added a new option
custom-logic
that allows executing custom logic after thatupdate-flake-lock.sh
is executed but before that the PR body is interpolated. The use case that justified this is that I wanted to put the output ofnix store diff-closures
inside the PR body. But I couldn't do this before the entireupdate-flake-lock
action since I needed to run it after that the lockfile was updated.Frankly I don't know if you want this, perhaps it's just an useless complication that will be useful for a small portion of people. Meanwhile I leave it here as a draft PR and only if you like it I'll add some lines in the README
Checklist