Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Sep 20, 2024
2 parents 6245ee9 + 7dc54aa commit 5ab62db
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 |
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions plone-package-test-notify/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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/[email protected]
with:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 5ab62db

Please sign in to comment.