diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index 9a9b02c..15d0601 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -37,18 +37,35 @@ jobs: shell: bash -l {0} run: mise exec -- tuist test PPACIOS-Workspace - - name: Notify Discord on Success + - name: Set build status + if: ${{ success() }} + run: echo "BUILD_STATUS=success" >> $GITHUB_ENV + - name: Set build status + if: ${{ failure() }} + run: echo "BUILD_STATUS=failure" >> $GITHUB_ENV + + notify-success: + name: Notify Discord on Success + runs-on: ubuntu-latest + needs: build + if: ${{ needs.build.outputs.BUILD_STATUS == 'success' }} + steps: + - name: Notify Discord env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - if: ${{ success() }} uses: Ilshidur/action-discord@master with: args: "✅ Tests passed for PR: ${{ github.event.pull_request.title }}. PR URL: ${{ github.event.pull_request.html_url }}" - - name: Notify Discord on Failure + notify-failure: + name: Notify Discord on Failure + runs-on: ubuntu-latest + needs: build + if: ${{ needs.build.outputs.BUILD_STATUS == 'failure' }} + steps: + - name: Notify Discord env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - if: ${{ failure() }} uses: Ilshidur/action-discord@master with: args: "❌ Tests failed for PR: ${{ github.event.pull_request.title }}. PR URL: ${{ github.event.pull_request.html_url }}"