generated from pmo-actions/healthchecks-ping
Actualiser README.md
This commit is contained in:
53
README.md
53
README.md
@@ -1,6 +1,6 @@
|
|||||||
# L'action `healthchecks-ping`
|
# L'action `software-version`
|
||||||
|
|
||||||
Cette action permet d’envoyer un *ping* vers un serveur [Healthchecks.io](https://healthchecks.io) (ou un serveur compatible).
|
Cette action extrait le numéro de version d’un logiciel à partir d’un fichier, généralement utilisé pour taguer une image Docker.
|
||||||
Elle est conçue pour être utilisée dans des workflows Gitea avec des runners auto-hébergés.
|
Elle est conçue pour être utilisée dans des workflows Gitea avec des runners auto-hébergés.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -8,54 +8,45 @@ Elle est conçue pour être utilisée dans des workflows Gitea avec des runners
|
|||||||
## 🔧 Utilisation
|
## 🔧 Utilisation
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Notify healthchecks
|
- name: Get software version
|
||||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/software-version@main
|
||||||
|
id: getversion
|
||||||
|
with:
|
||||||
|
version_file: my_version.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Le résultat est accessible via `${{ steps.getversion.outputs.version }}`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📥 Paramètres
|
## 📥 Paramètres
|
||||||
|
|
||||||
| Nom | Obligatoire | Par défaut | Description |
|
| Nom | Obligatoire | Par défaut | Description |
|
||||||
|------------------|-------------|------------|-----------------------------------------------------------------------------|
|
|------------------|-------------|--------------------------|-----------------------------------------------------------------------------|
|
||||||
| `check_server` | ✅ | – | Adresse du serveur Healthchecks, incluant `https://`. |
|
| `git_checkout` | ❌ | `false` | Clone le dépôt courant si activé. Utile si le fichier version est dans le repo. |
|
||||||
| `check_uuid` | ✅ | – | Identifiant UUID de la vérification. |
|
| `version_file` | ❌ | `software_version.txt` | Nom du fichier contenant la version du logiciel (1re ligne non vide utilisée). |
|
||||||
| `check_command` | ❌ | `stop` | Commande : `start`, `log`, `fail`, ou `stop`. |
|
| `debug` | ❌ | `false` | Mode débogage. Si activé, affiche des informations détaillées. |
|
||||||
| `check_message` | ❌ | `""` | Message transmis avec le ping (visible dans l’interface Healthchecks). |
|
|
||||||
| `debug` | ❌ | `false` | Affiche des messages de debug détaillés si activé. |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ▶️ Exemple de workflow
|
## ▶️ Exemple de workflow
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Notify healthchecks (start)
|
- name: Get version
|
||||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
id: getversion
|
||||||
with:
|
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/software-version@main
|
||||||
check_server: https://hc-ping.com
|
|
||||||
check_uuid: a1b2c3d4-1234-5678-9abc-def123456789
|
|
||||||
check_command: start
|
|
||||||
|
|
||||||
- name: Build my project
|
- name: Build image
|
||||||
run: make build
|
run: echo "Version: ${{ steps.getversion.outputs.version }}"
|
||||||
|
|
||||||
- name: Notify healthchecks (stop)
|
|
||||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/healthchecks-ping@main
|
|
||||||
with:
|
|
||||||
check_server: https://hc-ping.com
|
|
||||||
check_uuid: a1b2c3d4-1234-5678-9abc-def123456789
|
|
||||||
check_message: "Build terminé avec succès ✅"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ⚙️ Comportement
|
## ⚙️ Comportement
|
||||||
|
|
||||||
- Si `check_command: fail` est utilisé, **l’action échoue volontairement** (`exit 1`).
|
- Si le fichier spécifié n'existe pas, l'action échoue.
|
||||||
- Si `curl` échoue, l’action affiche l’erreur et échoue également.
|
- La première ligne non vide est utilisée comme version.
|
||||||
- L’URL appelée par `curl` dépend de la commande :
|
- Les espaces sont supprimés au début et à la fin, les espaces internes sont remplacés par des tirets.
|
||||||
- `https://<check_server>/ping/<uuid>` *(commande `stop` ou vide)*
|
|
||||||
- `https://<check_server>/ping/<uuid>/<check_command>` *(commande `start`, `log`, `fail`)*
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user