m7kvqbe1 / github-action-move-issues

A GitHub Action to move issues between GitHub Projects columns
3 stars 1 forks source link

Ignore project if issue not present #4

Open koppor opened 1 month ago

koppor commented 1 month ago

Follow-up to https://github.com/m7kvqbe1/github-action-move-issues/issues/3

In our setting, we have two projects: "Good first issues" and "Candidates for University Projects". An issue can be in 0, 1, or 2 of these projects. In case a contributor is assigned, the "State" should change to "Assigned" in the projects to reflect the state "transparently" for the users.

I would like to move the issue only if it is already present in a board.

Proposal: If ignored-columns contains <<not-in-project>>, then the issue is not added to the project.

koppor commented 1 month ago

One can add an issue to a project with the GitHub CLI:

  ui:
    if: "${{ github.event.label.name == 'ui' }}"
    runs-on: ubuntu-latest
    steps:
      - name: ui
        env:
          GH_DEBUG: api
          GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ITEM_ADD }}
        run: |
          ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
          echo $ISSUE_URL
          gh project item-add 8 --owner JabRef --url $ISSUE_URL

Therefore, it also would be OK for me that this action only moves issues if they are present in the project (and issues a warning output if the issue is not found in the given project).

koppor commented 1 month ago

Otherwise, the issue reads as follows:

image

m7kvqbe1 commented 1 month ago

Hmm this conflicts with some of our own requirements unfortunately.

Maybe we could add a flag that tells it to ignore issues that aren't already in the project?

koppor commented 1 month ago

Maybe we could add a flag that tells it to ignore issues that aren't already in the project?

Sure. My proposal for a flag was following:

Proposal: If ignored-columns contains <<not-in-project>>, then the issue is not added to the project.

I am also fine with an additional boolean setting such as add_to_project with default value true.

m7kvqbe1 commented 1 month ago

@koppor

PR here for this feature.