Skip to content

Commit

Permalink
Fix gh command that closes the issue when all vulnerabilities are fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Schwarze <[email protected]>
  • Loading branch information
SaschaSchwarze0 committed Jan 10, 2025
1 parent a3db753 commit 9537c71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/report-release-vulnerabilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ assignees="$(dyff json OWNERS | jq -r '.approvers | join(",")')"
issues="$(gh issue list --label release-vulnerabilities --json number)"

if [ "$(jq length <<<"${issues}")" == "0" ]; then

if [ "${hasVulnerabilities}" == "true" ]; then
# create new issue
echo "[INFO] Creating new issue"
Expand All @@ -133,7 +132,9 @@ else
--add-assignee "${assignees}" \
--body-file /tmp/report.md
else
gh issue close --reason "No vulnerabilities found in the latest release ${RELEASE_TAG}"
gh issue close "${issueNumber}" \
--comment "No vulnerabilities found in the latest release ${RELEASE_TAG}" \
--reason completed
fi
fi

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/report-release-vulnerabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ name: Report release vulnerabilities
on:
schedule:
- cron: '0 4 * * *' # 4:00 am UTC = 1 hour after base image build
release:
types:
- edited
- published
workflow_dispatch: {}
jobs:
report-vulnerabilities:
Expand Down

0 comments on commit 9537c71

Please sign in to comment.