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

Doesn't run after PR is merged #24

Open
rdegges opened this issue Sep 9, 2019 · 2 comments
Open

Doesn't run after PR is merged #24

rdegges opened this issue Sep 9, 2019 · 2 comments

Comments

@rdegges
Copy link

rdegges commented Sep 9, 2019

Hey there! I'm new to GitHub actions, so if this is incorrect at all, I apologize!

Here's the issue I'm seeing. I've got a repo that I'd like to use this with. We have a large team working on this project and many people are leaving stale branches around. Anyhow, I went ahead and created a GitHub workflow as defined below (using the new yaml syntax):

name: Delete PR Branches on Merge

on: pull_request
jobs:
  cleanup:
    name: Cleanup
    runs-on: ubuntu-latest

    steps:
    - uses: jessfraz/branch-cleanup-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        NO_BRANCH_DELETED_EXIT_CODE: 0

When I open a new pull request on this repo, this workflow runs and exits without doing anything (since the PR hasn't been merged).

When I merge the PR, however, this workflow doesn't run because it's only running on pull_request, and GitHub doesn't consider a merged PR to be a pull_request event, apparently. I wonder if this behavior has changed since this was first built?

Anyhow: I can't seem to find a way to get this to run. Am I way off, or did GitHub change the way that the pull_request event works?

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@rdegges
Copy link
Author

rdegges commented Sep 9, 2019

I think this is still a valid issue, but I just realized that GitHub has this functionality built-in by default now!

Sorry for the trouble. If anyone else stumbles across this like I did, this may be of use: https://help.github.com/en/articles/managing-the-automatic-deletion-of-branches

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

No branches or pull requests

1 participant