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

[Feature/Idea]: Allow WinGet Releaser GitHub Action to run on any event #1

Closed
russellbanks opened this issue May 8, 2022 · 11 comments
Labels
feat New feature request

Comments

@russellbanks
Copy link
Contributor

What would you like to see changed/added?

The Winget releaser action can currently only run if the workflow is a release event and a released event type, meaning the workflow has to look like this:

on:
  release:
    types: [released]

In my project, I have a workflow that runs whenever there's a new release, builds the app, and then uploads the artifacts to the release. The Windows run takes the longest usually, up to 5 minutes. This isn't ideal as the WinGet Releaser action has a wait time of 2.5 minutes before it should fail because it is unable to find the correct artifact, so I can pretty much guarantee that I am going to have to re-run it every time.

Therefore, to work around this, I could use the on: workflow_run to ensure that it will run after the Windows artifacts have been built and uploaded:

on:
  workflow_run:
    workflows: [Release]
    types:
      - completed

Therefore, allowing the WinGet Releaser GitHub Action to run on the workflow_run event, I won't have to re-run the action every time I make a release.

@russellbanks russellbanks added the feat New feature request label May 8, 2022
@ghost
Copy link

ghost commented May 8, 2022

Hello @russellbanks, thank you for submitting an issue!

@vedantmgoyal9
Copy link
Owner

I had already observed this issue on a couple of other repositories too, and am already working on a new retry logic. The action is limited to very specific event types to prevent spamming of pull requests at winget-pkgs repository.

BTW, thanks for telling me about workflow_run event, will add an exception for it.

Updated workflow (work-in-progress): https://github.com/vedantmgoyal2009/vedantmgoyal2009/blob/test/winget-pkgs-automation/releaser-action/action.yml

@vedantmgoyal9
Copy link
Owner

@allcontributors please add @russellbanks for ideas

@allcontributors
Copy link
Contributor

@vedantmgoyal2009

I've put up a pull request to add @russellbanks! 🎉

@vedantmgoyal9
Copy link
Owner

@russellbanks I was testing the action with the workflow_run event, but the problem is the action won't be able to get the release information automatically as it does now and my main concern while creating the action was only that a user would not have to supply everything as an input for the action.

Maybe the new retry logic can work for you, and if I will be able to find a way to do it without increasing the number of required inputs, I will surely add it. For now, I will keep it for the future.

@russellbanks
Copy link
Contributor Author

russellbanks commented May 10, 2022

Thank you for looking into this! I've had a look at the new retry logic and the wait time is definitely long enough for my use case.

@vedantmgoyal9
Copy link
Owner

Thanks! I will push it to v1.0.0 after some more testing.

@russellbanks
Copy link
Contributor Author

I've tried out the longer wait time it works much better, thank you!

@vedantmgoyal9 vedantmgoyal9 changed the title [Feature/Idea]: Allow WinGet Releaser GitHub Action to run on workflow_run event [Feature/Idea]: Allow WinGet Releaser GitHub Action to run on any event Jul 3, 2022
@vedantmgoyal9 vedantmgoyal9 reopened this Jul 3, 2022
@vedantmgoyal9
Copy link
Owner

vedantmgoyal9 commented Jul 3, 2022

@russellbanks, I've found a way to make the action work on any event. I'll update the action when I can get some free time 👍🏻

@russellbanks
Copy link
Contributor Author

@russellbanks, I've found a way to make the action work on any event. I'll update the action when I can get some free time 👍🏻

Since this original issue, I have actually been achieveing this by doing needs: [ build_release ] (only run when my build workflow is done), like OneFetch does. However, this would be super useful for getting other repositories to use WinGet Releaser, as they likely would be able to integrate it easier into their existing workflows :D

@vedantmgoyal9 vedantmgoyal9 transferred this issue from vedantmgoyal9/vedantmgoyal9 Jul 28, 2022
@vedantmgoyal9 vedantmgoyal9 removed their assignment Aug 9, 2022
@vedantmgoyal9
Copy link
Owner

A new input will be required if the workflow is not running on the release event: release-tag. Workflows triggering on:

on:
  push:
    tags:
      - v* # not exactly, you get the idea...

the value for release-tag can be set to ${{ github.ref }}. For other events, you may have to refer to theGitHub's documentation.

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

No branches or pull requests

2 participants