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

Action fails while running on master/main #18

Open
maxmcd opened this issue Jan 25, 2021 · 0 comments
Open

Action fails while running on master/main #18

maxmcd opened this issue Jan 25, 2021 · 0 comments

Comments

@maxmcd
Copy link

maxmcd commented Jan 25, 2021

Hello. First off we use this action at @voltusdev, thanks for making it.

When we merge PRs, it seems like the PR action still runs, even when the PR is closed/merged and we get the following error message:

Could not retrieve the Pull Request body

I was able to solve this by adding an if check to the run stanza:

      - name: Check for ticket
        if: ${{ github.ref != 'refs/heads/master' }}
        uses: neofinancial/ticket-check-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

I can't tell if this is expected, or maybe the error is because we auto-delete our branches, or maybe it's a bug with this check (but if it is, I wonder why I'm the first to experience it).

Any thoughts on this issue?

(here's the full text of our config, if that's helpful)

name: PR Ticket Check

on:
  pull_request:
    types: ['opened', 'edited', 'reopened', 'synchronize']
  status: {}
jobs:
  ticket-check:
    runs-on: ubuntu-latest
    steps:
      - name: Print env
        run: env
      - name: Check for ticket
        if: ${{ github.ref != 'refs/heads/master' }}
        uses: neofinancial/ticket-check-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ticketLink: 'https://github.com/voltusdev/voltus/issues/%ticketNumber%'
          ticketPrefix: '#'
          titleRegex: '^#(?<ticketNumber>\d+)'
          branchRegex: '^(?<ticketNumber>\d+)'
          bodyRegex: '#(?<ticketNumber>\d+)'
          bodyURLRegex: 'http(s?):\/\/(github.com)(\/voltusdev)(\/voltus)(\/issues)\/(?<ticketNumber>\d+)'
          exemptUsers: dependabot
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