diff --git a/.github/workflows/fix-pull-request-titles.yaml b/.github/workflows/fix-pull-request-titles.yaml index 6308efa..d62ccea 100644 --- a/.github/workflows/fix-pull-request-titles.yaml +++ b/.github/workflows/fix-pull-request-titles.yaml @@ -1,4 +1,3 @@ - name: Clean up PR title on: diff --git a/dingen b/dingen new file mode 100644 index 0000000..ef59341 --- /dev/null +++ b/dingen @@ -0,0 +1 @@ +dit zijn dingen. diff --git a/index.js b/index.js index 04d56bd..0551892 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,8 @@ const github = require('@actions/github'); const computePrTitle = require('./lib/compute-proper-title'); const findIssueInBranch = require('./lib/find-issue'); +core.info(`Starting action...`); + try { // Find token from request const token = core.getInput('token', { required: true }); @@ -25,6 +27,8 @@ try { || findIssueInBranch(pullRequest.data.head.ref) || findIssueInBranch(pullRequest.data.title); + core.info(`Ticket number ”${ticketNumber}” found.`); + // Get the current title as shorthand for comparison const prHeadRef = pullRequest.data.head.ref; const currentTitle = String(pullRequest.data.title); @@ -67,8 +71,12 @@ try { label.name.startsWith(ticketNumber.split("-")[0]) ); + core.info(`${labels.data.length} labels found.`); + // Add label to PR if found if (matchingLabelWithTicket) { + core.info(`Adding label “${matchingLabelWithTicket.name}” to PR...`); + octokit.rest.issues.addLabels({ owner: github.context.repo.owner, repo: github.context.repo.repo,