cicd: Automate proper version tagging in the bouncer.go that is reported to Crowdsec LAPI (#314)

* cicd(versioning): Automate proper version tagging in the bouncer.go that is reported to Crowdsec LAPI

* cicd(versioning): Move pluginVersion to it's own file

* Disablie lint check for no global variables

* Remove trailing new-line

* Update pluginVersion declaration style

* 🍱 Simplify for tests

Removed the verification step after updating the version and modified the commit message to include an emoji.

---------

Co-authored-by: maxlerebourg <maxlerebourg@gmail.com>
This commit is contained in:
Shadoweee77
2026-02-19 23:41:55 +01:00
committed by GitHub
co-authored by maxlerebourg
parent 889c5b55fe
commit c2bbc4dac5
3 changed files with 52 additions and 2 deletions
+2 -2
View File
@@ -674,7 +674,7 @@ func crowdsecQuery(bouncer *Bouncer, stringURL string, data []byte) ([]byte, err
req, _ = http.NewRequest(http.MethodGet, stringURL, nil)
}
req.Header.Add(bouncer.crowdsecHeader, bouncer.crowdsecKey)
req.Header.Add("User-Agent", "Crowdsec-Bouncer-Traefik-Plugin/1.X.X")
req.Header.Add("User-Agent", "Crowdsec-Bouncer-Traefik-Plugin/"+pluginVersion)
res, err := bouncer.httpClient.Do(req)
if err != nil {
@@ -779,7 +779,7 @@ func reportMetrics(bouncer *Bouncer) error {
metrics := map[string]interface{}{
"remediation_components": []map[string]interface{}{
{
"version": "1.X.X",
"version": pluginVersion,
"type": "bouncer",
"name": "traefik_plugin",
"metrics": []map[string]interface{}{