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

create-or-update-issue: add action #588

Merged
merged 1 commit into from
Sep 23, 2024
Merged

create-or-update-issue: add action #588

merged 1 commit into from
Sep 23, 2024

Conversation

ZhongRuoyu
Copy link
Member

SMillerDev
SMillerDev previously approved these changes Sep 18, 2024
create-issue/action.yml Outdated Show resolved Hide resolved
SMillerDev
SMillerDev previously approved these changes Sep 18, 2024
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good! I think it might be nice to make this a little higher level such that it will also autoclose an issue on success and open a new issue on failure. Maybe even post more comments on repeated failures? Thoughts?

create-issue/action.yml Outdated Show resolved Hide resolved
@ZhongRuoyu
Copy link
Member Author

ZhongRuoyu commented Sep 19, 2024

Sorry, have been a little bit busy this week. I'll get back to this soon.

I think it might be nice to make this a little higher level such that it will also autoclose an issue on success and open a new issue on failure. Maybe even post more comments on repeated failures? Thoughts?

How about this: we turn this into an action that's able to perform the following depending on ${{ steps.some-previous-step.conclusion }}:

  • failure: looks for an issue with the same title, and posts a new comment under it if found, or opens a new one otherwise.
  • success: closes the existing issue with the same title, if any.

With usage like:

- uses: Homebrew/actions/create-issue@master
  with:
    token: ${{ github.token }}
    repository: ${{ github.repository }}
    update-existing: true
    close-existing: true
    dependent-step-conclusion: ${{ steps.deploy.conclusion }} 
    title: Deployment failed
    body: Issue body (or comment to post if issue already exists)
    labels: label1,label2
    assignees: user1,user2

@MikeMcQuaid
Copy link
Member

@ZhongRuoyu This seems great!

create-issue/action.yml Outdated Show resolved Hide resolved
create-issue/action.yml Outdated Show resolved Hide resolved
create-issue/main.test.mjs Outdated Show resolved Hide resolved
@ZhongRuoyu ZhongRuoyu force-pushed the create-issue branch 2 times, most recently from e6931fc to 42a7fa0 Compare September 20, 2024 17:03
@ZhongRuoyu ZhongRuoyu changed the title create-issue: add action create-or-update-issue: add action Sep 20, 2024
Bo98
Bo98 previously approved these changes Sep 20, 2024
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Looks great!

create-or-update-issue/main.mjs Outdated Show resolved Hide resolved
create-or-update-issue/README.md Outdated Show resolved Hide resolved
Related: Homebrew/homebrew-core#190657 (comment)

Co-authored-by: Sean Molenaar <[email protected]>
Co-authored-by: Mike McQuaid <[email protected]>
Co-authored-by: Bo Anderson <[email protected]>
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @ZhongRuoyu! After merging: could you update formulae.brew.sh and homebrew/core to use this action and, if you're feeling really generous, add to the Homebrew/brew release workflow that uploads packages 🙇🏻

@ZhongRuoyu
Copy link
Member Author

Sure! I'll first do formulae.brew.sh as that's run most frequently. If that works well I'll roll this out to more places.

@ZhongRuoyu ZhongRuoyu merged commit 06ed333 into master Sep 23, 2024
3 checks passed
@ZhongRuoyu ZhongRuoyu deleted the create-issue branch September 23, 2024 08:23
ZhongRuoyu added a commit to ZhongRuoyu/formulae.brew.sh that referenced this pull request Sep 23, 2024
This was added in Homebrew/actions#588. It simplifies the workflow, and
reduces the number of API calls.
ZhongRuoyu added a commit to ZhongRuoyu/formulae.brew.sh that referenced this pull request Sep 23, 2024
This was added in Homebrew/actions#588. It simplifies the workflow, and
reduces the number of API calls.
ZhongRuoyu added a commit to Homebrew/brew that referenced this pull request Sep 24, 2024
This uses the `Homebrew/actions/create-or-update-issue` action added in
Homebrew/actions#588 to create an issue when the publish fails for a
release. It also automatically updates the issue on repeated failures,
and closes the issue when the latest workflow run succeeds.
ZhongRuoyu added a commit to Homebrew/homebrew-core that referenced this pull request Sep 24, 2024
This was added in Homebrew/actions#588. It can also automatically update
an existing issue on repeated failures, or close the issue when the
latest workflow run is successful.
ZhongRuoyu added a commit to Homebrew/homebrew-core that referenced this pull request Sep 24, 2024
This was added in Homebrew/actions#588. It can also automatically update
an existing issue on repeated failures, or close the issue when the
latest workflow run is successful.
ZhongRuoyu added a commit to Homebrew/rubydoc.brew.sh that referenced this pull request Sep 24, 2024
This was added in Homebrew/actions#588. It simplifies the workflow, and
reduces the number of API calls.

See also:
Homebrew/formulae.brew.sh@f444253.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants