diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..ab071a5 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -20,6 +20,10 @@ ############################################################################### name: Python Unit Tests +permissions: + contents: read + issues: write + on: workflow_dispatch: # Allows the workflow to be manually triggered from the GitHub Actions tab pull_request: # @@ -68,12 +72,40 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: ${{ always() }} runs-on: ubuntu-latest steps: - name: Notify on test results + env: + GH_TOKEN: ${{ github.token }} + NOTIFY_USER: ${{ vars.NOTIFY_USER || github.actor }} run: | + echo "## Python Unit Test Result" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "Result: ${{ needs.python-unit-tests.result }}" >> "$GITHUB_STEP_SUMMARY" + if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" + echo "Python unit tests passed. No failure notification needed." + echo "Python unit tests passed. No failure notification needed." >> "$GITHUB_STEP_SUMMARY" else - echo "failure notifications go here" - fi + echo "::error title=Python unit tests failed::The Python unit test job failed. Please inspect the workflow logs." + + cat > issue_body.md <> "$GITHUB_STEP_SUMMARY" + fi \ No newline at end of file