Skip to content

Commit

Permalink
fix workflow: now will update title, added sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Feb 21, 2024
1 parent 198d5f2 commit eb5e6f5
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/release-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,34 @@ env:

jobs:

# workflow and siibra-python will likely break with tag including /
# workflow: see sed
# siibra-python: see reftag escaping
sanitiy-check:
runs-on: ubuntu-latest
steps:
- name: "checks tag does not contain slash"
run: |
echo ${{ env.TAG_NAME }} | grep -Fq "/" && exit 1 || exit 0
get-all-opened:
runs-on: ubuntu-latest
needs:
- sanitiy-check
if: success()
outputs:
OPEN_ISSUES: ${{ steps.get-all-issues.outputs.ALL_ISSUES }}
steps:
- name: 'Getting all opened issue matching ${{ env.RELEASE_CHECKLIST_TAG }} in ${{ env.REPO }}'
id: 'get-all-issues'
run: |
id_body=$(gh issue list \
issue=$(gh issue list \
--repo ${{ env.REPO }} \
--label '${{ env.RELEASE_CHECKLIST_TAG }}' \
--json 'id,body,number,url')
--json 'id,body,number,url,title')
echo Found:
echo $id_body
echo "ALL_ISSUES=$id_body" >> $GITHUB_OUTPUT
echo $issue
echo "ALL_ISSUES=$issue" >> $GITHUB_OUTPUT
update-existing-body:
runs-on: ubuntu-latest
Expand All @@ -39,12 +52,13 @@ jobs:
echo Found open issues: $OPEN_ISSUES
for issue in $(echo $OPEN_ISSUES | jq -c '.[]')
then
id=$(echo $issue | jq -r '.id')
url=$(echo $issue | jq -r '.url')
new_issue_body=$(echo $issue | jq -r '.body' | sed '1s/master/${{ env.TAG_NAME }}/')
new_title=$(echo $issue | jq -r '.title' | sed 's/v???/${{ env.TAG_NAME }}/')
echo update issue $url
echo new_title=$new_title
echo new_issue_body: $new_issue_body
echo -e $new_issue_body | gh issue edit "$url" -F -
Expand All @@ -62,9 +76,8 @@ jobs:
then
url=$(echo $issue | jq -r '.url')
echo $id_body | jq -r '.body' | grep -Fq "<person name>"
echo $issue | jq -r '.body' | grep -Fq "<person name>"
validated=$(echo $?)
new_comment="Thank you ${{ env.ACTOR }} for the release."
if [[ "$validated" != "0" ]]
Expand All @@ -86,10 +99,10 @@ jobs:
run: |
OPEN_ISSUES=${{ needs.get-all-opened.outputs.OPEN_ISSUES }}
echo Found open issues: $OPEN_ISSUES
for id_body in $(echo $OPEN_ISSUES | jq -c '.[]')
for issue in $(echo $OPEN_ISSUES | jq -c '.[]')
then
id=$(echo $id_body | jq -r '.id')
url=$(echo $id_body | jq -r '.url')
id=$(echo $issue | jq -r '.id')
url=$(echo $issue | jq -r '.url')
gh issue close $url -r completed
fi
Expand All @@ -101,7 +114,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: |
new_issue=$(sed '1s/LATEST_TAG_PLACEHOLDER/siibra-1.0.0/' release_checklist.md)
new_issue=$(sed '1s/LATEST_TAG_PLACEHOLDER/${{ env.TAG_NAME }}/' release_checklist.md)
echo -e new_issue: $new_issue
Expand Down

0 comments on commit eb5e6f5

Please sign in to comment.