Skip to content

Commit

Permalink
fix: edit update (pre)release title on success/failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sigilioso committed Apr 12, 2024
1 parent 99a1099 commit 21fc88a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ jobs:
packageLocation: repo
stagingRepo: true
upgrade: false
- uses: actions/checkout@v4
- name: Update title for successful pre-release
env:
GH_TOKEN: "${{ secrets.COREINT_BOT_TOKEN }}"
run: |
gh release edit ${{ github.event.release.tag_name }} --title "${{ github.event.release.tag_name }}"
notify-failure:
if: ${{ always() && failure() }}
Expand All @@ -214,3 +220,15 @@ jobs:
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }}
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }}
slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: [prerelease pipeline failed](${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }})."

update-release-title-on-failure:
if: ${{ always() && failure() }}
needs: [ test-nix, test-windows, prerelease, package-win, publish-to-s3 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Reflect failure in pre-release title
env:
GH_TOKEN: "${{ secrets.COREINT_BOT_TOKEN }}"
run: |
gh release edit ${{ github.event.release.tag_name }} --title "${{ github.event.release.tag_name }} (pre-release-failure)"
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ jobs:
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }}
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }}
slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: [release pipeline failed](${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }})."

update-release-title-on-failure:
if: ${{ always() && failure() }}
needs: [ publish-to-s3 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Reflect failure in release title
env:
GH_TOKEN: "${{ secrets.COREINT_BOT_TOKEN }}"
run: |
gh release edit ${{ github.event.release.tag_name }} --title "${{ github.event.release.tag_name }} (release-failure)"

0 comments on commit 21fc88a

Please sign in to comment.