Skip to content

Commit 1600f40

Browse files
committed
fix: deployment success assertion for releases
1 parent 6c196cc commit 1600f40

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/k8s_apply.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
7575
- name: Assert Deploy Success
7676
shell: bash
77-
if: env.ENVIRONMENT_NAME == 'dev'
7877
run: |
7978
bash cicd-deployment-scripts/k8s/assert_deploy_success.sh \
8079
-n ${{ env.KUBERNETES_NAMESPACE }} \

gh/pr_create.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@ EXISTING_PR_NUMBER=""
2626
EXISTING_PR_BODY=$(gh pr list --base $BASE_REF --head $HEAD_REF --json body --jq '.[].body')
2727

2828
if [ -z "$EXISTING_PR_BODY" ]; then
29-
PR_BODY=$(cat <<EOF
29+
if [[ $REPOSITORY_PR_NUMBER =~ ^v(0|[1-9]*)\.(0|[1-9]*)\.(0|[1-9]*) ]]; then
30+
PR_BODY=$(cat <<EOF
31+
Automated $BASE_REF release for:
32+
- https://github.com/$REPOSITORY_OWNER/$REPOSITORY_NAME/releases/tag/$REPOSITORY_PR_NUMBER
33+
EOF
34+
)
35+
else
36+
PR_BODY=$(cat <<EOF
3037
Automated $BASE_REF release for:
3138
- https://github.com/$REPOSITORY_OWNER/$REPOSITORY_NAME/pull/$REPOSITORY_PR_NUMBER
3239
EOF
3340
)
41+
3442
gh pr create \
3543
--base $BASE_REF \
3644
--head $HEAD_REF \

k8s/assert_deploy_success.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ done
1616
kubectl config set-context --current --namespace=$KUBERNETES_NAMESPACE
1717
echo "Context set to namespace: \"$KUBERNETES_NAMESPACE\""
1818

19-
UPDATED_FILES=$(gh pr diff $PR_NUMBER --name-only)
19+
UPDATED_FILES=$(gh pr diff $PR_NUMBER --name-only || git diff $(git tag --sort version:refname | tail -n 2 | head -n 1) $(git tag --sort version:refname | tail -n 1) --name-only)
2020
while IFS= read -r file; do
2121
if [[ $file != apps/* ]]; then
2222
continue

0 commit comments

Comments
 (0)