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

Workflow dispatch support #433

Closed
chancez opened this issue Jul 25, 2024 · 0 comments · Fixed by #434
Closed

Workflow dispatch support #433

chancez opened this issue Jul 25, 2024 · 0 comments · Fixed by #434
Labels
enhancement New feature or request

Comments

@chancez
Copy link
Contributor

chancez commented Jul 25, 2024

Is your feature request related to a problem? Please describe.

I'd like to be able to manually trigger the workflow with the PR number as an input.

I have a couple of use cases for this:

  • I make changes to the GHA inputs and want it to execute against a PR that's already been merged
  • The PR was merged before the workflow existed
  • The PR was missing the labels the workflow selected for when it was merged
  • The workflow failed (retrying might work, though if it failed and needed updates to the inputs, then this won't work, since retrying reuses the workflow at the time the job was executed).

Based on the code here: https://github.com/korthout/backport-action/blob/main/src/github.ts#L57-L65 and some trial/error, it doesn't seem to work with workflow dispatch events.

Describe the solution you'd like
An input variable to specify the PR number to run against, and if set, it takes precedence over the value in the payload.

Describe alternatives you've considered

It could directly check the payload for workload_dispatch rather than accepting new inputs for the PR directly, however I that's less flexible and requires the workflow to be written a particular way.

Additional context

I tried with workflow dispatch already and got this error:

Run chancez/backport-action@pr/chancez/static_labels
Retrieve pull request data for #undefined
Check whether pull request undefined is merged
Create comment: Only merged pull requests can be backported.
HttpError: Not Found
    at /home/runner/work/_actions/chancez/backport-action/pr/chancez/static_labels/node_modules/@octokit/request/dist-node/index.js:112:1
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
@chancez chancez added the enhancement New feature or request label Jul 25, 2024
chancez added a commit to chancez/backport-action that referenced this issue Jul 25, 2024
Fixes korthout#433

Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant