Skip to content

Add output "ticketNumber" - #58

Draft
koppor wants to merge 2 commits into
neofinancial:masterfrom
koppor:add-action-output
Draft

Add output "ticketNumber"#58
koppor wants to merge 2 commits into
neofinancial:masterfrom
koppor:add-action-output

Conversation

@koppor

@koppor koppor commented Mar 11, 2025

Copy link
Copy Markdown

Note: I needed to add build/index.js to be able to test.

Summary

Fixes #57

Now the action can be used to output the determined ticket number. One can also configure outputOnly to use only the determination of the ticket number.

Example use:

      - name: Determine issue number
        id: get_issue_number
        uses: koppor/ticket-check-action@add-output
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ticketLink: 'https://github.com/:owner/:repo/issues/%ticketNumber%'
          ticketPrefix: '#'
          titleRegex: '^#(?<ticketNumber>\d+)'
          branchRegex: '^(?<ticketNumber>\d+)'
          bodyRegex: '#(?<ticketNumber>\d+)'
          bodyURLRegex: 'http(s?):\/\/(github.com)(\/:owner)(\/:repo)(\/issues)\/(?<ticketNumber>\d+)'
          outputOnly: true
      - name: Move issue to "Backlog"
        uses: m7kvqbe1/github-action-move-issues/@add-issue-parameter
        with:
          github-token: ${{ secrets.GH_TOKEN_ACTION_MOVE_ISSUE }}
          project-url: "https://github.com/users/koppor/projects/7"
          target-labels: "📍 Assigned"
          target-column: "Backlog"
          ignored-columns: ""
          default-column: "Backlog"
          issue-number: ${{ steps.get_issue_number.outputs.ticketNumber }}
          skip-if-not-in-project: true

Updated dependencies

none

Future work

none

Checklist

  • Have you fully tested your PR locally?
  • Have you written thorough tests for your work?
  • Have you made a CHANGELOG entry?

@koppor

koppor commented Mar 19, 2025

Copy link
Copy Markdown
Author

@neofinancial I successfully used this variant of the action for dozens of PRs. Could you consider reviewing it and merging?

@koppor

koppor commented Apr 18, 2025

Copy link
Copy Markdown
Author

Can't get it to work to output "-1" in the case of no ticket number; currently only "" is output in case no regex matches. --> JabRef/jabref#12951 (comment)

Update Used wrong variable name: JabRef/jabref@e724f88 (#12951)

@koppor

koppor commented Apr 18, 2025

Copy link
Copy Markdown
Author

With an issue number, it works now

Next step: check for workflows without an issue number

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.

Output ticket number

1 participant