Skip to content

Commit

Permalink
Merge pull request #39 from UlisesGascon/feat/36
Browse files Browse the repository at this point in the history
feat: added issue assignation and labels
  • Loading branch information
UlisesGascon authored Mar 17, 2023
2 parents 0390bc1 + bbf1b26 commit 468db23
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _soon_
- Discovery mode: list all the repos in one or many organizations that are tracked in the OpenSSF Scorecard
- Reporting in Markdown with essential information (hash, date, score) and comparative against the prior score.
- Self-hosted: The reporting data is stored in json format (including previous records) in the repo itself.
- Generate an issue with the last changes in the scores, including links to the full report.
- Generate an issue (assignation, labels..) with the last changes in the scores, including links to the full report.
- Easy to exclude/include new repositories in the scope from any github organization
- Extend the markdown template with you own content by using tags
- Easy to modify the files and ensure the integrity with Json Schemas
Expand Down Expand Up @@ -102,6 +102,8 @@ jobs:
- `auto-push`: Pushes the code changes to the branch
- `generate-issue`: Creates an issue with the scores that had been updated
- `issue-title`: Defines the issue title
- `issue-assignees`: List of assignees for the issue
- `issue-labels`: List of labels for the issue
- `github-token`: The token usage to create the issue and push the code
- `max-request-in-parallel`: Defines the total HTTP Request that can be done in parallel
- `discovery-enabled`: Defined if the discovery is enabled
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ inputs:
description: 'Title of the issue to be generated'
required: false
default: "OpenSSF Scorecard Report Updated!"
issue-assignees:
description: 'List of assignees for the issue to be generated'
required: false
issue-labels:
description: 'List of labels for the issue to be generated'
required: false
discovery-enabled:
description: 'Enable the automatic update of the scope file'
required: false
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28153,6 +28153,8 @@ async function run () {
const autoPush = normalizeBoolean(core.getInput('auto-push'))
const autoCommit = normalizeBoolean(core.getInput('auto-commit'))
const issueTitle = core.getInput('issue-title') || 'OpenSSF Scorecard Report Updated!'
const issueAssignees = core.getInput('issue-assignees').split(',').filter(x => x !== '').map(x => x.trim()) || []
const issueLabels = core.getInput('issue-labels').split(',').filter(x => x !== '').map(x => x.trim()) || []
const githubToken = core.getInput('github-token')
const discoveryEnabled = normalizeBoolean(core.getInput('discovery-enabled'))
const discoveryOrgs = core.getInput('discovery-orgs').split(',').filter(x => x !== '').map(x => x.trim()) || []
Expand Down Expand Up @@ -28275,7 +28277,9 @@ async function run () {
await octokit.rest.issues.create({
...context.repo,
title: issueTitle,
body: issueContent
body: issueContent,
labels: issueLabels,
assignees: issueAssignees
})
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ async function run () {
const autoPush = normalizeBoolean(core.getInput('auto-push'))
const autoCommit = normalizeBoolean(core.getInput('auto-commit'))
const issueTitle = core.getInput('issue-title') || 'OpenSSF Scorecard Report Updated!'
const issueAssignees = core.getInput('issue-assignees').split(',').filter(x => x !== '').map(x => x.trim()) || []
const issueLabels = core.getInput('issue-labels').split(',').filter(x => x !== '').map(x => x.trim()) || []
const githubToken = core.getInput('github-token')
const discoveryEnabled = normalizeBoolean(core.getInput('discovery-enabled'))
const discoveryOrgs = core.getInput('discovery-orgs').split(',').filter(x => x !== '').map(x => x.trim()) || []
Expand Down Expand Up @@ -145,7 +147,9 @@ async function run () {
await octokit.rest.issues.create({
...context.repo,
title: issueTitle,
body: issueContent
body: issueContent,
labels: issueLabels,
assignees: issueAssignees
})
}
}
Expand Down

0 comments on commit 468db23

Please sign in to comment.