Skip to content

Commit abf60d1

Browse files
committed
Search for the release maintenance issue
1 parent 91f2bd4 commit abf60d1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/generate-release-maintenance.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
permissions:
2929
contents: write
3030
pull-requests: write
31+
issues: read
3132

3233
steps:
3334
- name: Checkout code
@@ -75,14 +76,23 @@ jobs:
7576
7677
PR_NUMBER=$(gh pr list --head "$BRANCH_NAME" --base "$BASE_BRANCH" --json number,headRepositoryOwner --jq ".[] | select(.headRepositoryOwner.login == \"$FORK_OWNER\") | .number" | head -n 1)
7778
79+
# Search for the release maintenance issue
80+
ISSUE_NUMBER=$(gh issue list --repo "$GH_REPO" --search "\"$VERSION\" \"Rancher Manager Release Maintenance Task Checklist\" in:title is:open" --json number --jq '.[0].number')
81+
82+
PR_BODY="Automated release maintenance updates for version $VERSION."$'\n'"Command executed: \`./release-maintenance.sh -t \"$TAG\" -d \"$DATE\" --prime \"$PRIME\" --community \"$COMMUNITY\"\`"
83+
84+
if [[ -n "$ISSUE_NUMBER" && "$ISSUE_NUMBER" != "null" ]]; then
85+
PR_BODY="$PR_BODY"$'\n\n'"Relates to #$ISSUE_NUMBER"
86+
fi
87+
7888
if [[ -n "$PR_NUMBER" && "$PR_NUMBER" != "null" ]]; then
7989
gh pr edit "$PR_NUMBER" \
8090
--title "$VERSION - Release Maintenance" \
81-
--body "Automated release maintenance updates for version $VERSION."$'\n'"Command executed: \`./release-maintenance.sh -t \"$TAG\" -d \"$DATE\" --prime \"$PRIME\" --community \"$COMMUNITY\"\`"
91+
--body "$PR_BODY"
8292
else
8393
PR_URL=$(gh pr create \
8494
--title "$VERSION - Release Maintenance" \
85-
--body "Automated release maintenance updates for version $VERSION."$'\n'"Command executed: \`./release-maintenance.sh -t \"$TAG\" -d \"$DATE\" --prime \"$PRIME\" --community \"$COMMUNITY\"\`" \
95+
--body "$PR_BODY" \
8696
--base "$BASE_BRANCH" \
8797
--head "${FORK_OWNER}:${BRANCH_NAME}")
8898
PR_NUMBER=${PR_URL##*/}

0 commit comments

Comments
 (0)