Skip to content

Commit cabb427

Browse files
committed
ci: try
1 parent 7df82d8 commit cabb427

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/create-pull-request.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: create-pull-request
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- "v*.*.*-ci-test*"
77

88
jobs:
99
create-abbs-pr:
@@ -34,18 +34,19 @@ jobs:
3434
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3535
run: |
3636
cd ./aosc-os-abbs/app-admin/oma
37-
source ./spec
3837
git config user.name "eatradish"
3938
git config user.email "[email protected]"
4039
# Check if the `oma-preview' branch exists, create if not.
41-
if ! git rev-parse --verify origin/oma-preview > /dev/null; then
42-
git checkout -b oma-preview
40+
if ! git rev-parse --verify origin/oma-preview-ci-test > /dev/null; then
41+
git checkout -b oma-preview-ci-test
4342
else
4443
# Checkout the existing branch.
45-
git checkout oma-preview
44+
git checkout oma-preview-ci-test
4645
# Rebase the branch. Failing rebases will need to be handled manually.
4746
git rebase stable
4847
fi
48+
# Get the baseline version.
49+
source ./spec
4950
# Note: Use tilde (~) to denote pre-release, allowing users to upgrade to a final release later.
5051
export DPKG_VER=$(echo ${RELEASE_VERSION} | sed -e 's|v||g' | sed -e 's|-|~|g')
5152
sed -e "s|VER=$VER|VER=${DPKG_VER}|g" -i spec
@@ -54,9 +55,22 @@ jobs:
5455
git add .
5556
git commit -m "oma: update to ${DPKG_VER}"
5657
# Note: Git not allow tilde (~) in branch names, so use dash here.
57-
git push --set-upstream --force origin oma-preview
58-
uri=$(echo -e "Topic Description\n-----------------\n\n- oma: update to ${DPKG_VER}\n\nPackage(s) Affected\n-------------------\n\n- oma: ${DPKG_VER}\n\nSecurity Update?\n----------------\n\nNo\n\nBuild Order\n-----------\n\n\`\`\`\n#buildit oma\n\`\`\`\n\nTest Build(s) Done\n------------------\n\n**Primary Architectures**\n\n- [ ] AMD64 \`amd64\`\n- [ ] AArch64 \`arm64\`\n- [ ] LoongArch 64-bit \`loongarch64\`\n\n**Secondary Architectures**\n\n- [ ] Loongson 3 \`loongson3\`\n- [ ] PowerPC 64-bit (Little Endian) \`ppc64el\`\n- [ ] RISC-V 64-bit \`riscv64\`\n\n\n" | \
59-
gh pr create -d --title "oma: update to ${DPKG_VER}" -l "upgrade,preview" -F -)
58+
git push --set-upstream --force origin oma-preview-ci-test
59+
# https://github.com/cli/cli/discussions/5792#discussioncomment-10410197
60+
export PR_URL="$(gh pr list --head oma-preview-ci-test --state open --json url --jq .[].url)"
61+
export PR_BODY="$(echo -e "Topic Description\n-----------------\n\n- oma: update to ${DPKG_VER}\n\nPackage(s) Affected\n-------------------\n\n- oma: ${DPKG_VER}\n\nSecurity Update?\n----------------\n\nNo\n\nBuild Order\n-----------\n\n\`\`\`\n#buildit oma\n\`\`\`\n\nTest Build(s) Done\n------------------\n\n**Primary Architectures**\n\n- [ ] AMD64 \`amd64\`\n- [ ] AArch64 \`arm64\`\n- [ ] LoongArch 64-bit \`loongarch64\`\n\n**Secondary Architectures**\n\n- [ ] Loongson 3 \`loongson3\`\n- [ ] PowerPC 64-bit (Little Endian) \`ppc64el\`\n- [ ] RISC-V 64-bit \`riscv64\`\n\n\n")"
62+
if [[ -n "${PR_URL}" ]]; then
63+
uri=$(gh pr create \
64+
-d \
65+
--title "oma: update to ${DPKG_VER}" \
66+
-l "upgrade,preview" \
67+
-F ${PR_BODY})
68+
else
69+
uri=$(gh pr edit $(basename ${PR_URL}) \
70+
--title "oma: update to ${DPKG_VER}" \
71+
-l "upgrade,preview" \
72+
-F ${PR_BODY})
73+
fi
6074
num=$(basename ${uri})
6175
curl --header "Content-Type: application/json" \
6276
--request POST \

0 commit comments

Comments
 (0)