Skip to content

Commit 468db23

Browse files
authored
Merge pull request #39 from UlisesGascon/feat/36
feat: added issue assignation and labels
2 parents 0390bc1 + bbf1b26 commit 468db23

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _soon_
1717
- Discovery mode: list all the repos in one or many organizations that are tracked in the OpenSSF Scorecard
1818
- Reporting in Markdown with essential information (hash, date, score) and comparative against the prior score.
1919
- Self-hosted: The reporting data is stored in json format (including previous records) in the repo itself.
20-
- Generate an issue with the last changes in the scores, including links to the full report.
20+
- Generate an issue (assignation, labels..) with the last changes in the scores, including links to the full report.
2121
- Easy to exclude/include new repositories in the scope from any github organization
2222
- Extend the markdown template with you own content by using tags
2323
- Easy to modify the files and ensure the integrity with Json Schemas
@@ -102,6 +102,8 @@ jobs:
102102
- `auto-push`: Pushes the code changes to the branch
103103
- `generate-issue`: Creates an issue with the scores that had been updated
104104
- `issue-title`: Defines the issue title
105+
- `issue-assignees`: List of assignees for the issue
106+
- `issue-labels`: List of labels for the issue
105107
- `github-token`: The token usage to create the issue and push the code
106108
- `max-request-in-parallel`: Defines the total HTTP Request that can be done in parallel
107109
- `discovery-enabled`: Defined if the discovery is enabled

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ inputs:
2525
description: 'Title of the issue to be generated'
2626
required: false
2727
default: "OpenSSF Scorecard Report Updated!"
28+
issue-assignees:
29+
description: 'List of assignees for the issue to be generated'
30+
required: false
31+
issue-labels:
32+
description: 'List of labels for the issue to be generated'
33+
required: false
2834
discovery-enabled:
2935
description: 'Enable the automatic update of the scope file'
3036
required: false

dist/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28153,6 +28153,8 @@ async function run () {
2815328153
const autoPush = normalizeBoolean(core.getInput('auto-push'))
2815428154
const autoCommit = normalizeBoolean(core.getInput('auto-commit'))
2815528155
const issueTitle = core.getInput('issue-title') || 'OpenSSF Scorecard Report Updated!'
28156+
const issueAssignees = core.getInput('issue-assignees').split(',').filter(x => x !== '').map(x => x.trim()) || []
28157+
const issueLabels = core.getInput('issue-labels').split(',').filter(x => x !== '').map(x => x.trim()) || []
2815628158
const githubToken = core.getInput('github-token')
2815728159
const discoveryEnabled = normalizeBoolean(core.getInput('discovery-enabled'))
2815828160
const discoveryOrgs = core.getInput('discovery-orgs').split(',').filter(x => x !== '').map(x => x.trim()) || []
@@ -28275,7 +28277,9 @@ async function run () {
2827528277
await octokit.rest.issues.create({
2827628278
...context.repo,
2827728279
title: issueTitle,
28278-
body: issueContent
28280+
body: issueContent,
28281+
labels: issueLabels,
28282+
assignees: issueAssignees
2827928283
})
2828028284
}
2828128285
}

src/action.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ async function run () {
2323
const autoPush = normalizeBoolean(core.getInput('auto-push'))
2424
const autoCommit = normalizeBoolean(core.getInput('auto-commit'))
2525
const issueTitle = core.getInput('issue-title') || 'OpenSSF Scorecard Report Updated!'
26+
const issueAssignees = core.getInput('issue-assignees').split(',').filter(x => x !== '').map(x => x.trim()) || []
27+
const issueLabels = core.getInput('issue-labels').split(',').filter(x => x !== '').map(x => x.trim()) || []
2628
const githubToken = core.getInput('github-token')
2729
const discoveryEnabled = normalizeBoolean(core.getInput('discovery-enabled'))
2830
const discoveryOrgs = core.getInput('discovery-orgs').split(',').filter(x => x !== '').map(x => x.trim()) || []
@@ -145,7 +147,9 @@ async function run () {
145147
await octokit.rest.issues.create({
146148
...context.repo,
147149
title: issueTitle,
148-
body: issueContent
150+
body: issueContent,
151+
labels: issueLabels,
152+
assignees: issueAssignees
149153
})
150154
}
151155
}

0 commit comments

Comments
 (0)