Search code examples
githubgithub-actionsgithub-issues

Github action workflow triggered on pushes rather than issue creation


I have a github workflow that is supposed to interact with issues when they are created or labeled. This works on about half of the repos where I added it and on the other half, it runs (and fails) on every push but does not run when issues are created or labeled. What could be going wrong? Is there a good way to debug which workflows are triggered on different github events?

The config is as follows and is exactly the same in each repo:

name: issue_board

on:
  issues:
    types:
      - opened
      - labeled
jobs:
  add-to-project:
    name: Add an issue to a board
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: [redacted]
          github-token: [redacted]
          labeled: "Type: Enhancement", "Type: Bug"
          label-operator: OR
      - uses: actions/add-to-project@main
        with:
          project-url: [redacted]
          github-token: [redacted]
          labeled: "Type: Documentation"

Solution

  • It turned out that the field labeled in the action was a single string, not a list of strings (this was a slight difference between the multiple repos where I had this workflow). I'm not sure why the failure mode was to run the workflow on a different set of events than the ones specified.