From 01f5e6a08dc8155992a7436f55de7579973f5823 Mon Sep 17 00:00:00 2001 From: rdubois Date: Fri, 13 Sep 2024 10:20:03 +0200 Subject: [PATCH 1/7] chore: use plone/code-analysis-action instead of our fork --- CHANGELOG.md | 5 +++++ code-analysis-notify/action.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d080e..aa40af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [unreleased] - xxxx-xx-xx +### Changed +- code-analysis-notify + - use plone composite action instead of our fork + ## [v3.9.3] - 2024-08-13 ### Fixed - helm-release-notify diff --git a/code-analysis-notify/action.yml b/code-analysis-notify/action.yml index 77c86ea..93ec30b 100644 --- a/code-analysis-notify/action.yml +++ b/code-analysis-notify/action.yml @@ -34,7 +34,7 @@ runs: - name: Checkout uses: actions/checkout@v4 - name: Run checks - uses: IMIO/code-analysis-action@main + uses: plone/code-analysis-action@main with: check: ${{ inputs.CHECK }} path: ${{ inputs.PATH }} From 2992a7da295edc4ece5004520c4b532e1c3ccd9b Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 13:57:32 +0200 Subject: [PATCH 2/7] feat(code-analysis-notify): use our fork action --- code-analysis-notify/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-analysis-notify/action.yml b/code-analysis-notify/action.yml index 93ec30b..93022c6 100644 --- a/code-analysis-notify/action.yml +++ b/code-analysis-notify/action.yml @@ -34,7 +34,7 @@ runs: - name: Checkout uses: actions/checkout@v4 - name: Run checks - uses: plone/code-analysis-action@main + uses: IMIO/gha/code-analysis-action@main with: check: ${{ inputs.CHECK }} path: ${{ inputs.PATH }} From 6e688096f9f1337e930267ab385c3f9062477a6d Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 14:04:23 +0200 Subject: [PATCH 3/7] fix(code-analysis-notify): typo in action name --- code-analysis-notify/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code-analysis-notify/action.yml b/code-analysis-notify/action.yml index 93022c6..77c86ea 100644 --- a/code-analysis-notify/action.yml +++ b/code-analysis-notify/action.yml @@ -34,7 +34,7 @@ runs: - name: Checkout uses: actions/checkout@v4 - name: Run checks - uses: IMIO/gha/code-analysis-action@main + uses: IMIO/code-analysis-action@main with: check: ${{ inputs.CHECK }} path: ${{ inputs.PATH }} From 38843a81335f556adc76209258ebdaf887beadbe Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 15:27:18 +0200 Subject: [PATCH 4/7] feat(plone-package-test-notify): cache key as parameter --- plone-package-test-notify/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plone-package-test-notify/action.yml b/plone-package-test-notify/action.yml index 8553aa6..4fe29f1 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: From 4ea34f101a89091e10e1feacf2085d8c50c9575a Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 15:49:54 +0200 Subject: [PATCH 5/7] feat(plone-package-test-notify): more info on mattermost notification message --- plone-package-test-notify/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plone-package-test-notify/action.yml b/plone-package-test-notify/action.yml index 4fe29f1..0986324 100644 --- a/plone-package-test-notify/action.yml +++ b/plone-package-test-notify/action.yml @@ -59,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 @@ -70,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 From 184236b606b277c323fe4bb13775a25534f1d071 Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 17:13:29 +0200 Subject: [PATCH 6/7] doc: update README and CHANGELOG --- CHANGELOG.md | 7 ++++--- README.md | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa40af6..0e6ae36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## [unreleased] - xxxx-xx-xx +## [v3.9.4] - 2024-09-19 ### Changed -- code-analysis-notify - - use plone composite action instead of our fork +- plone-package-test-notify + - More info on mattermost notification message + - Optional CACHE_KEY input ## [v3.9.3] - 2024-08-13 ### Fixed diff --git a/README.md b/README.md index 62506a7..02869a4 100644 --- a/README.md +++ b/README.md @@ -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 | From 7dc54aa0805dfa753149ca52ec04e1dcb5d5cba1 Mon Sep 17 00:00:00 2001 From: rdubois Date: Thu, 19 Sep 2024 17:19:36 +0200 Subject: [PATCH 7/7] doc: add examples --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02869a4..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 @@ -201,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