From 138db94bfe4b12ac11fc1aff307ee0835feab403 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Tue, 5 Dec 2023 17:14:14 +0100 Subject: [PATCH] allow assigning users to the newly-created issues (#30) * allow passing a list of assigned users * use a comma-separated string instead * use github script (node?) to split the string * use a variable instead * document that all users have to have commit rights --- action.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 81d9f95..8dc8435 100644 --- a/action.yaml +++ b/action.yaml @@ -16,6 +16,12 @@ inputs: Labels to apply to issue required: false default: "CI" + assignees: + description: >- + Comma-separated users to assign to the issue (no spaces). All assigned users have to + have commit rights. + required: false + default: "" outputs: {} branding: color: "red" @@ -46,6 +52,7 @@ runs: const fs = require('fs'); const pytest_logs = fs.readFileSync('pytest-logs.txt', 'utf8'); const title = "${{ inputs.issue-title }}" + const assignees = "${{inputs.assignees}}".split(",") const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}` const issue_body = `[Workflow Run URL](${workflow_url})\n${pytest_logs}` @@ -80,7 +87,8 @@ runs: repo: variables.name, body: issue_body, title: title, - labels: [variables.label] + labels: [variables.label], + assignees: assignees }) } else { github.rest.issues.update({