Compare commits

...

7 commits
v0.3.0 ... main

Author SHA1 Message Date
Marcel S. Henselin
45a4a7e647 fix: fix linting
Some checks failed
CI / lint (push) Failing after 3m58s
CI / release (push) Successful in 6m30s
2026-04-17 17:27:40 +02:00
Marcel S. Henselin
c1349c7e40 fix: push tag was incorrect
Some checks failed
CI / lint (push) Failing after 2m16s
CI / release (push) Failing after 4m39s
2026-04-17 17:16:22 +02:00
Marcel S. Henselin
bd882b6d3e fix: push tag was incorrect
Some checks failed
CI / lint (push) Failing after 2m52s
CI / release (push) Failing after 4m1s
2026-04-17 17:11:29 +02:00
semantic-release-bot
a2d6cf9305 chore(release): 0.3.1 [skip ci]
## [0.3.1](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.3.0...v0.3.1) (2026-04-17)

### Bug Fixes

* pipeline fixes ([b195a1d](b195a1dcfd))
2026-04-17 15:03:16 +00:00
Marcel S. Henselin
b195a1dcfd fix: pipeline fixes
Some checks failed
CI / lint (push) Failing after 2m12s
CI / release (push) Failing after 5m5s
2026-04-17 16:58:37 +02:00
Marcel S. Henselin
e12834bc14 chore: subtitle in notification
Some checks failed
CI / lint (push) Failing after 2m49s
CI / release (push) Failing after 4m2s
[skip-ci]
2026-04-17 16:47:33 +02:00
Marcel S. Henselin
6b34a9774b chore: pipeline adjustments
Some checks failed
CI / lint (push) Has been cancelled
CI / release (push) Has been cancelled
2026-04-17 16:44:59 +02:00
8 changed files with 138 additions and 67 deletions

View file

@ -2,7 +2,7 @@ name: Sample Testing
on: [workflow_dispatch]
env:
VER: 0.1.2
VER: 0.3.1
jobs:
my_job:

View file

@ -8,7 +8,7 @@ on:
- '**'
env:
VER: 0.1.2
VER: 0.3.1
# If a 403 error occurs, make sure to set content permission to write
# see: https://github.com/go-semantic-release/action/issues/27
@ -54,11 +54,12 @@ jobs:
outputs:
tag: ${{ steps.create_release.outputs.tag }}
steps:
- name: "[START] release workflow"
- name: "đź–… [START] release workflow"
if: ${{ always() }}
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v${{ env.VER }}
with:
title: "[START] release workflow (${{ forgejo.run_number }})"
subtitle: "${{ forgejo.repostitory }}"
author: ${{ forgejo.actor }}
giturl: ${{ forgejo.server_url }}
iconslug: instacart
@ -90,6 +91,7 @@ jobs:
run: |
npx \
-p semantic-release \
-p semantic-release-replace-plugin \
-p @semantic-release/commit-analyzer \
-p @semantic-release/release-notes-generator \
-p @semantic-release/changelog \
@ -124,14 +126,15 @@ jobs:
if: steps.create_release.outputs.tag != ''
uses: docker/build-push-action@v7
with:
push: false
tags: actions/notify-slim:${{ steps.create_release.outputs.tag }}
push: true
tags: stackit-solutions.git.onstackit.cloud/actions/notify-slim:${{ steps.create_release.outputs.tag }}
- name: "[END] release workflow"
- name: "đź–… [END] release workflow"
if: ${{ always() }}
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v${{ env.VER }}
with:
title: "[START] release workflow (${{ forgejo.run_number }})"
title: "[END] release workflow (${{ forgejo.run_number }})"
subtitle: "${{ forgejo.repostitory }}"
author: ${{ forgejo.actor }}
giturl: ${{ forgejo.server_url }}
iconslug: instacart

View file

@ -70,9 +70,7 @@ linters:
- name: empty-lines
- name: early-return
exclusions:
paths:
- generator/
- internal/testutils
paths: []
generated: lax
warn-unused: true
# Excluding configuration per-path, per-linter, per-text and per-source.

View file

@ -3,8 +3,76 @@
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
[
"semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["action.yml"],
"from": " image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v.*'",
"to": " image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v${nextRelease.version}'",
"results": [
{
"file": "action.yml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
{
"files": ["README.md"],
"from": " uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v.*",
"to": " uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v${nextRelease.version}",
"results": [
{
"file": "README.md",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
{
"files": [".github/workflows/example.yml"],
"from": " VER: .*",
"to": " VER: ${nextRelease.version}",
"results": [
{
"file": ".github/workflows/example.yml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
{
"files": [".github/workflows/release.yml"],
"from": " VER: .*",
"to": " VER: ${nextRelease.version}",
"results": [
{
"file": ".github/workflows/release.yml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/git"
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "README.md", "action.yml", ".github/workflows/example.yml", ".github/workflows/release.yml"]
}
]
]
}

View file

@ -1,3 +1,10 @@
## [0.3.1](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.3.0...v0.3.1) (2026-04-17)
### Bug Fixes
* pipeline fixes ([b195a1d](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/b195a1dcfdd7bf98eaaeb976d08260a2457da317))
# [0.3.0](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.2.0...v0.3.0) (2026-04-17)

View file

@ -16,7 +16,7 @@ jobs:
# ... all your steps
- name: Sample Chat Message
if: ${{ always() }} # runs als after fails
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.1.2
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.3.1
with:
title: "[START] sample test (${{ forgejo.run_number }})"
author: ${{ forgejo.actor }}

100
main.go
View file

@ -42,6 +42,56 @@ func main() {
data.CardID = uuid.NewString()
data.Add = ""
getData(&data)
webhook := githubactions.GetInput("webhook")
if webhook == "" {
githubactions.Fatalf("Missing input 'webhook'")
os.Exit(1)
}
webhook = fmt.Sprintf("%s&threadKey=notify%s&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD", webhook, data.ActionID)
giturl := githubactions.GetInput("giturl")
if giturl == "" {
githubactions.Fatalf("Missing input 'giturl'")
os.Exit(1)
}
data.GitURL = giturl
body := githubactions.GetInput("event_body")
data.EventBody = body
githubactions.Infof("using URL: %s", webhook)
jsonStr, err := card(data)
if err != nil {
githubactions.Fatalf("err %s", err.Error())
os.Exit(1)
}
req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(jsonStr))
if err != nil {
githubactions.Fatalf("error %s", err.Error())
os.Exit(1)
}
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
githubactions.Fatalf("error %s", err.Error())
os.Exit(1)
}
defer resp.Body.Close() //nolint:gocritic
fmt.Println("response Status:", resp.Status)
if resp.StatusCode != http.StatusOK {
githubactions.Infof("json: %s", jsonStr)
githubactions.Fatalf("response: %+v\n", resp)
os.Exit(1)
}
}
func getData(data *templateData) {
prj, ok := os.LookupEnv("FORGEJO_REPOSITORY")
if ok {
data.Project = prj
@ -84,56 +134,6 @@ func main() {
os.Exit(1)
}
data.ActionID = actionid
webhook := githubactions.GetInput("webhook")
if webhook == "" {
githubactions.Fatalf("Missing input 'webhook'")
os.Exit(1)
}
webhook = fmt.Sprintf("%s&threadKey=notify%s&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD", webhook, data.ActionID)
giturl := githubactions.GetInput("giturl")
if giturl == "" {
githubactions.Fatalf("Missing input 'giturl'")
os.Exit(1)
}
data.GitURL = giturl
body := githubactions.GetInput("event_body")
data.EventBody = body
githubactions.Infof("using URL: %s", webhook)
// fmt.Println("URL:> ", webhook)
// var jsonStr = []byte(fmt.Sprintf(data, project, commit, branch, status, actionid))
jsonStr, err := card(data)
if err != nil {
githubactions.Fatalf("error %s", err.Error())
os.Exit(1)
}
// log.Printf("retrieved data: %s", string(jsonStr))
req, err := http.NewRequest("POST", webhook, bytes.NewBuffer(jsonStr))
if err != nil {
githubactions.Fatalf("error %s", err.Error())
os.Exit(1)
}
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
githubactions.Fatalf("error %s", err.Error())
os.Exit(1)
}
defer resp.Body.Close()
fmt.Println("response Status:", resp.Status)
if resp.StatusCode != http.StatusOK {
githubactions.Infof("json: %s", jsonStr)
githubactions.Fatalf("response: %+v\n", resp)
os.Exit(1)
}
}
func card(d templateData) ([]byte, error) {

View file

@ -27,8 +27,6 @@ func Test_card(t *testing.T) {
Author: "gotest",
IconUrl: "https://github.githubassets.com/images/modules/logos_page/Octocat.png",
Project: "proj",
Commit: "12345",
Branch: "main",
Status: "success",
ActionID: "123",
GitURL: "https://test.url",
@ -115,9 +113,6 @@ func Test_card(t *testing.T) {
t.Fatalf("error: %v\nsrc: %s", err, tt.want)
}
//if !reflect.DeepEqual(wantJson, gotJson) {
// t.Errorf("card() got = %v, want %v", gotJson, wantJson)
//}
if diff := cmp.Diff(wantJson, gotJson); diff != "" {
t.Errorf("MakeGatewayInfo() mismatch (-want +got):\n%s", diff)
}