Skip to content

Commit

Permalink
fix(updatecli): fix gh issue create
Browse files Browse the repository at this point in the history
  • Loading branch information
smerle33 committed Feb 10, 2025
1 parent aca83cd commit e63129d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions updatecli/scripts/createIssue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ set -eux -o pipefail

command -v "gh" >/dev/null 2>&1 || { echo "ERROR: gh command not found. Exiting."; exit 1; }

cmd=$(cat <<- EOM
cmd=$(cat <<-EOM
gh issue create --title "[private.vpn.jenkins.io] $1 VPN CRL expires" \
--body "follow https://github.com/jenkins-infra/docker-openvpn?tab=readme-ov-file#howto-renew-certificate-revocation-list \
See https://github.com/jenkins-infra/helpdesk/issues/4266 for details." \
--label crl \
--label updatecli \
--label triage \
--repo jenkins-infra/helpdesk
EOM
)

if test "$DRY_RUN" == "false"
if test "${DRY_RUN:=true}" == "false"
then
export GITHUB_TOKEN="${UPDATECLI_GITHUB_TOKEN}"
alreadyOpened=$(gh issue list --repo jenkins-infra/helpdesk --state open --search "label:crl label:updatecli" | wc -l)
if test "$alreadyOpened" -eq 0
then
"${cmd}"
eval "${cmd}"
else
echo "issue already opened"
fi
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/crl.enddate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ conditions:
command: bash ./updatecli/scripts/datediff.sh
environments:
- name: PATH

targets:
createIssue:
kind: shell
Expand Down

0 comments on commit e63129d

Please sign in to comment.