diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d080e..0e6ae36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v3.9.4] - 2024-09-19 +### Changed +- plone-package-test-notify + - More info on mattermost notification message + - Optional CACHE_KEY input + ## [v3.9.3] - 2024-08-13 ### Fixed - helm-release-notify diff --git a/README.md b/README.md index 62506a7..2973ab6 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ This github action uses the [code-analysis-action](https://github.com/plone/code #### Example of usage -/ +[IMIO/imio.smartweb.core](https://github.com/IMIO/imio.smartweb.core/blob/fdb331eb004eed0744f419264f063a336b40d069/.github/workflows/plone-package-test-gha.yml#L16) --- ### deb-build-push-notify @@ -192,6 +192,7 @@ Test a Plone package and optionally notify via a mattermost webhook | name | required | type | default | description | | ---------------------- | -------- | ------ | ------------------ | ----------- | +| CACHE_KEY | no | string | | key to use in actions/cache | | PYTHON_VERSION | yes | string | "3.10" | Python version to use | | TEST_COMMAND | yes | string | "bin/test" | Test command to run | | REQUIREMENTS_FILE | yes | string | "requirements.txt" | Requirements file | @@ -200,7 +201,7 @@ Test a Plone package and optionally notify via a mattermost webhook #### Example of usage -/ +[IMIO/imio.smartweb.core](https://github.com/IMIO/imio.smartweb.core/blob/fdb331eb004eed0744f419264f063a336b40d069/.github/workflows/plone-package-test-gha.yml#L33) --- ### plone-theme-build-push-notify diff --git a/plone-package-test-notify/action.yml b/plone-package-test-notify/action.yml index 8553aa6..0986324 100644 --- a/plone-package-test-notify/action.yml +++ b/plone-package-test-notify/action.yml @@ -1,6 +1,9 @@ name: Run code analysis description: Run code analysis and notify on Mattermost inputs: + CACHE_KEY: + description: 'Cache key' + required: false PYTHON_VERSION: description: 'Python version to use' required: true @@ -29,13 +32,13 @@ runs: - name: Checkout uses: actions/checkout@v4 - name: Cache eggs + if: ${{ inputs.CACHE_KEY != '' }} uses: actions/cache@v4 env: cache-name: cache-eggs with: path: ./eggs - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} + key: ${{ inputs.CACHE_KEY }} - name: Setup Python ${{ inputs.PYTHON_VERSION }} uses: actions/setup-python@v5.1.1 with: @@ -56,7 +59,7 @@ runs: if: ${{ inputs.MATTERMOST_WEBHOOK_URL != '' }} run: | JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - MESSAGE="Test has run successfully. (Repository: ${{ github.repository }}, Branch: ${{ github.ref_name }}, Commit: ${{ github.sha }}) [Click here to see job on GitHub]($JOB_URL)" + MESSAGE="Test has run successfully. (Repository: ${{ github.repository }}, Branch: ${{ github.ref_name }}, Commit: ${{ github.sha }}, Test command: ${{ inputs.TEST_COMMAND }}, Python version: ${{ inputs.PYTHON_VERSION }}) [Click here to see job on GitHub]($JOB_URL)" curl -i -X POST -H 'Content-Type: application/json' -d "{\"text\": \"$MESSAGE\"}" ${{ inputs.MATTERMOST_WEBHOOK_URL }} shell: bash - name : Send failure notification on Mattermost @@ -67,6 +70,6 @@ runs: NEW_IMAGE_TAGS: ${{ inputs.NEW_IMAGE_TAGS }} run: | JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - MESSAGE="Error : Test has failed. (Repository: ${{ github.repository }}, Branch: ${{ github.ref_name }}, Commit: ${{ github.sha }}) [Click here to see job on GitHub]($JOB_URL)" + MESSAGE="Error : Test has failed. (Repository: ${{ github.repository }}, Branch: ${{ github.ref_name }}, Commit: ${{ github.sha }}, Test command: ${{ inputs.TEST_COMMAND }}, Python version: ${{ inputs.PYTHON_VERSION }}) [Click here to see job on GitHub]($JOB_URL)" curl -i -X POST -H 'Content-Type: application/json' -d "{\"text\": \"$MESSAGE\"}" ${{ inputs.MATTERMOST_WEBHOOK_URL }} shell: bash \ No newline at end of file