Skip to content

Commit 7c8230a

Browse files
committed
Refine NSC promotion PR text
1 parent 51546fc commit 7c8230a

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

.github/workflows/promote-nsc-channel.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -273,32 +273,40 @@ jobs:
273273
pr_head="${HEAD_OWNER}:${PR_BRANCH}"
274274
fi
275275
276-
existing_pr="$(gh pr list \
276+
pr_title="CI: Promote NSC channel to ${SOURCE_SHA}"
277+
release_url="https://github.com/${ASSET_REPO}/releases/tag/${RELEASE_TAG}"
278+
commit_url="https://github.com/${SOURCE_REPO}/commit/${SOURCE_SHA}"
279+
body_file="${RUNNER_TEMP}/nsc-promote-pr.md"
280+
cat > "${body_file}" <<EOF
281+
Promote \`${CHANNEL}\` to [\`${RELEASE_TAG}\`](${release_url}).
282+
283+
- source commit: [\`${SOURCE_SHA}\`](${commit_url})
284+
- source run: [\`${RUN_ID}\`](${RUN_URL})
285+
- manifest repo release: [\`${RELEASE_TAG}\`](${release_url})
286+
EOF
287+
288+
existing_pr_number="$(gh pr list \
277289
--repo "${TARGET_REPO}" \
278290
--base "${TARGET_BRANCH}" \
279291
--head "${pr_head}" \
280-
--json url \
281-
--jq '.[0].url')"
282-
283-
if [[ -n "${existing_pr}" && "${existing_pr}" != "null" ]]; then
284-
echo "url=${existing_pr}" >> "${GITHUB_OUTPUT}"
292+
--json number \
293+
--jq '.[0].number')"
294+
295+
if [[ -n "${existing_pr_number}" && "${existing_pr_number}" != "null" ]]; then
296+
gh pr edit "${existing_pr_number}" \
297+
--repo "${TARGET_REPO}" \
298+
--title "${pr_title}" \
299+
--body-file "${body_file}"
300+
existing_pr_url="$(gh pr view "${existing_pr_number}" --repo "${TARGET_REPO}" --json url --jq '.url')"
301+
echo "url=${existing_pr_url}" >> "${GITHUB_OUTPUT}"
285302
exit 0
286303
fi
287304
288-
body_file="${RUNNER_TEMP}/nsc-promote-pr.md"
289-
cat > "${body_file}" <<EOF
290-
Promote \`${CHANNEL}\` to \`${RELEASE_TAG}\`.
291-
292-
- source commit: \`${SOURCE_SHA}\`
293-
- source run: ${RUN_URL}
294-
- manifest repo release: https://github.com/${ASSET_REPO}/releases/tag/${RELEASE_TAG}
295-
EOF
296-
297305
pr_url="$(gh pr create \
298306
--repo "${TARGET_REPO}" \
299307
--base "${TARGET_BRANCH}" \
300308
--head "${pr_head}" \
301-
--title "Promote NSC channel to ${SOURCE_SHA}" \
309+
--title "${pr_title}" \
302310
--body-file "${body_file}")"
303311
304312
echo "url=${pr_url}" >> "${GITHUB_OUTPUT}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NSC Channel Promotion
1+
# NSC Promotion
22

33
This document describes the Nabla-specific promotion flow for the prebuilt `NSC` toolchain channel.
44

docs/nsc-toolchain-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ Consumers read the unpacked `.dvc` files committed to this repository.
151151

152152
## Promotion flow
153153

154-
Repository-specific promotion details are described in [nsc-channel-promotion.md](nsc-channel-promotion.md).
154+
Repository-specific promotion details are described in [nsc-promotion.md](nsc-promotion.md).

0 commit comments

Comments
 (0)