Skip to content

Commit f566b0c

Browse files
authored
[workflow] fixed broken rellease workflows (#2604)
1 parent f7458d3 commit f566b0c

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.github/workflows/release_docker_after_merge.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ jobs:
5959
id: message-preparation
6060
run: |
6161
url=$SERVER_URL/$REPO/actions/runs/$RUN_ID
62-
63-
if [ $STATUS == 'success' ]
62+
if [ "$STATUS" == 'success' ]
6463
then
6564
msg="The Docker image for the latest release has been successfully built and pushed to DockerHub."
6665
else
@@ -73,4 +72,4 @@ jobs:
7372
REPO: ${{ github.repository }}
7473
RUN_ID: ${{ github.run_id }}
7574
WEBHOOK_URL: ${{ secrets.LARK_NOTIFICATION_WEBHOOK_URL }}
76-
STATUS: ${{ steps.docker-push.outcome }}
75+
STATUS: ${{ needs.release.result }}

.github/workflows/release_pypi_after_merge.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
notify:
3636
name: Notify Lark via webhook
37-
needs: release
37+
needs: build-n-publish
3838
runs-on: ubuntu-latest
3939
if: ${{ always() }}
4040
steps:
@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
url=$SERVER_URL/$REPO/actions/runs/$RUN_ID
5454
55-
if [ $STATUS == 'success' ]
55+
if [ "$STATUS" == 'success' ]
5656
then
5757
msg="The Colossal-AI latest version has been successfully released to PyPI."
5858
else
@@ -65,4 +65,4 @@ jobs:
6565
REPO: ${{ github.repository }}
6666
RUN_ID: ${{ github.run_id }}
6767
WEBHOOK_URL: ${{ secrets.LARK_NOTIFICATION_WEBHOOK_URL }}
68-
STATUS: ${{ steps.publish.outcome }}
68+
STATUS: ${{ needs.build-n-publish.result }}

.github/workflows/scripts/generate_release_draft.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def collate_release_info(commit_info_list):
5757

5858
for commit_info in commit_info_list:
5959
author = commit_info['commit']['author']['name']
60-
author_url = commit_info['author']['url']
60+
61+
try:
62+
author_url = commit_info['author']['url']
63+
except:
64+
# author can be None
65+
author_url = None
6166
msg = commit_info['commit']['message']
6267
match = re.search(pattern, msg)
6368

@@ -86,7 +91,10 @@ def generate_release_post_markdown(current_version, last_version, release_info):
8691
# only keep the first line
8792
msg = msg.split('\n')[0]
8893

89-
item = f'{msg} by [{author}]({author_url})\n'
94+
if author_url:
95+
item = f'{msg} by [{author}]({author_url})\n'
96+
else:
97+
item = f'{msg} by {author}\n'
9098
text.append(f'- {item}')
9199

92100
text.append('\n')

0 commit comments

Comments
 (0)