From 16a5f874b341a6d4776dbe5e46be391f1d6576d8 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:21:59 +0200 Subject: [PATCH 01/11] feat: linting --- .github/workflows/example.yml | 10 ++++----- .github/workflows/release.yml | 38 ++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index dba744a..db1f183 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -1,5 +1,5 @@ name: Sample Testing -on: [push] +on: [workflow_dispatch] env: VER: 0.1.2 @@ -22,10 +22,10 @@ jobs: webhook: "${{ secrets.WEBHOOK_URL }}" # event_body: "" # optional - - name: Force failure - run: | - echo "This is a force failure" - exit 1 +# - name: Force failure +# run: | +# echo "This is a force failure" +# exit 1 - name: Second Chat Message as ThreadResponse if: ${{ always() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2890b3e..7b8174d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,9 @@ on: branches: - '**' +env: + VER: 0.1.2 + # If a 403 error occurs, make sure to set content permission to write # see: https://github.com/go-semantic-release/action/issues/27 permissions: @@ -25,7 +28,9 @@ jobs: go-version: 1.26 - name: GO Linting - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v9 + with: + version: v2.11 # build: # runs-on: stackit-docker @@ -47,6 +52,17 @@ jobs: outputs: tag: ${{ steps.create_release.outputs.tag }} steps: + - 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 }})" + author: ${{ forgejo.actor }} + giturl: ${{ forgejo.server_url }} + iconslug: instacart + actionid: ${{ forgejo.run_number }} + webhook: "${{ secrets.WEBHOOK_URL }}" + - name: Checkout code uses: actions/checkout@v6 @@ -95,8 +111,28 @@ jobs: if: steps.create_release.outputs.tag != '' uses: docker/setup-buildx-action@v4 + - name: Build only + if: steps.create_release.outputs.tag == '' + uses: docker/build-push-action@v7 + with: + push: false + tags: actions/notify-slim:dev + - name: Build and push + if: steps.create_release.outputs.tag != '' uses: docker/build-push-action@v7 with: push: false tags: actions/notify-slim:${{ steps.create_release.outputs.tag }} + + - 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 }})" + author: ${{ forgejo.actor }} + giturl: ${{ forgejo.server_url }} + iconslug: instacart + actionid: ${{ forgejo.run_number }} + webhook: "${{ secrets.WEBHOOK_URL }}" + status: 'completed' From 68c1f11a5cc02918166ca05e4af79712a5c0964b Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:25:48 +0200 Subject: [PATCH 02/11] feat: linting --- .golang-ci.yaml => .golangci.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .golang-ci.yaml => .golangci.yaml (100%) diff --git a/.golang-ci.yaml b/.golangci.yaml similarity index 100% rename from .golang-ci.yaml rename to .golangci.yaml From 49fa812459a33b0161984f68cd8fa2b0b8b40119 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:30:34 +0200 Subject: [PATCH 03/11] chore: pipeline adjustments --- .github/workflows/release.yml | 4 +++- go.sum | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 go.sum diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b8174d..11353fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,9 @@ jobs: - name: Setup GO uses: actions/setup-go@v6 with: - go-version: 1.26 + # go-version: 1.26 + go-version-file: 'go.mod' + cache-dependency-path: 'go.sum' - name: GO Linting uses: golangci/golangci-lint-action@v9 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b8212ad --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/sethvargo/go-githubactions v1.3.2 h1:gkibLr/QjosgNWoCf1V58rTMRZw7xZtSB7dY4atbl1Y= +github.com/sethvargo/go-githubactions v1.3.2/go.mod h1:7/4WeHgYfSz9U5vwuToCK9KPnELVHAhGtRwLREOQV80= From eb96639c1744914daabced7ba1336e09dbe0eae1 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 17 Apr 2026 14:36:40 +0000 Subject: [PATCH 04/11] chore(release): 0.3.0 [skip ci] # [0.3.0](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.2.0...v0.3.0) (2026-04-17) ### Features * linting ([68c1f11](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/68c1f11a5cc02918166ca05e4af79712a5c0964b)) * linting ([16a5f87](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/16a5f874b341a6d4776dbe5e46be391f1d6576d8)) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3428ef0..ce6aa2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [0.3.0](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.2.0...v0.3.0) (2026-04-17) + + +### Features + +* linting ([68c1f11](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/68c1f11a5cc02918166ca05e4af79712a5c0964b)) +* linting ([16a5f87](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/16a5f874b341a6d4776dbe5e46be391f1d6576d8)) + # [0.2.0](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.1.2...v0.2.0) (2026-04-17) From 6b34a9774bda30f52f0a9dcd8cd3706d5b7719bb Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:44:54 +0200 Subject: [PATCH 05/11] chore: pipeline adjustments --- .github/workflows/release.yml | 8 ++--- .golangci.yaml | 4 +-- .releaserc.json | 63 +++++++++++++++++++++++++++++++++++ main_test.go | 2 -- 4 files changed, 68 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11353fb..f7d656b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ 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: @@ -124,14 +124,14 @@ jobs: if: steps.create_release.outputs.tag != '' uses: docker/build-push-action@v7 with: - push: false + push: true tags: 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 }})" author: ${{ forgejo.actor }} giturl: ${{ forgejo.server_url }} iconslug: instacart diff --git a/.golangci.yaml b/.golangci.yaml index b5d12d0..35b6ac1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -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. diff --git a/.releaserc.json b/.releaserc.json index d36c572..2f60e7a 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -3,6 +3,69 @@ "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" diff --git a/main_test.go b/main_test.go index 5c04597..ec0da17 100644 --- a/main_test.go +++ b/main_test.go @@ -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", From e12834bc14074918194a828d8c76b7239fefe4fd Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:47:33 +0200 Subject: [PATCH 06/11] chore: subtitle in notification [skip-ci] --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7d656b..ae6e9a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,6 +59,7 @@ jobs: 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 @@ -132,6 +133,7 @@ jobs: uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v${{ env.VER }} with: title: "[END] release workflow (${{ forgejo.run_number }})" + subtitle: "${{ forgejo.repostitory }}" author: ${{ forgejo.actor }} giturl: ${{ forgejo.server_url }} iconslug: instacart From b195a1dcfdd7bf98eaaeb976d08260a2457da317 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 16:58:37 +0200 Subject: [PATCH 07/11] fix: pipeline fixes --- .github/workflows/release.yml | 1 + .releaserc.json | 7 ++- main.go | 111 +++++++++++++++++++--------------- 3 files changed, 68 insertions(+), 51 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae6e9a1..710f44e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,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 \ diff --git a/.releaserc.json b/.releaserc.json index 2f60e7a..8310b91 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -68,6 +68,11 @@ ], "@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"] + } + ] ] } diff --git a/main.go b/main.go index 12cb578..b8674a8 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,8 @@ import ( "bytes" _ "embed" "fmt" + "io" + "log" "net/http" "os" "text/template" @@ -42,6 +44,65 @@ 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) + // fmt.Println("URL:> ", webhook) + + // var jsonStr = []byte(fmt.Sprintf(data, project, commit, branch, status, actionid)) + + jsonStr, err := card(data) + if err != nil { + githubactions.Fatalf("err %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 func(Body io.ReadCloser) { + err := Body.Close() + if err != nil { + log.Fatalln(err) + } + }(resp.Body) + 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 +145,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) { From a2d6cf9305785018f1c6bcc98a4cb3e91061674e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 17 Apr 2026 15:03:16 +0000 Subject: [PATCH 08/11] 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](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/b195a1dcfdd7bf98eaaeb976d08260a2457da317)) --- .github/workflows/example.yml | 2 +- .github/workflows/release.yml | 2 +- CHANGELOG.md | 7 +++++++ README.md | 2 +- action.yml | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index db1f183..0e5d3be 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -2,7 +2,7 @@ name: Sample Testing on: [workflow_dispatch] env: - VER: 0.1.2 + VER: 0.3.1 jobs: my_job: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 710f44e..0a83b6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index ce6aa2e..24b7be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 97d5ff4..c4e8400 100644 --- a/README.md +++ b/README.md @@ -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 }} diff --git a/action.yml b/action.yml index 7487391..4adf444 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ inputs: runs: using: 'docker' - image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.1.2' + image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.3.1' # image: 'Dockerfile' args: - ${{ inputs.project }} From bd882b6d3e44e9aa42a1691b55a019080d5f5074 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 17:11:29 +0200 Subject: [PATCH 09/11] fix: push tag was incorrect --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a83b6a..581badf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,7 +127,7 @@ jobs: uses: docker/build-push-action@v7 with: push: true - tags: actions/notify-slim:${{ steps.create_release.outputs.tag }} + tags: stackit-solutions.git.onstackit.cloud/actions/notify-slim:${{ steps.create_release.outputs.tag }} - name: "🖅 [END] release workflow" if: ${{ always() }} From c1349c7e406f71134df603df738bc650c1b77ae9 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 17:16:22 +0200 Subject: [PATCH 10/11] fix: push tag was incorrect --- action.yml | 2 +- main.go | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 4adf444..41b10f8 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ inputs: runs: using: 'docker' - image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.3.1' + image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.2.1' # image: 'Dockerfile' args: - ${{ inputs.project }} diff --git a/main.go b/main.go index b8674a8..be6ccd9 100644 --- a/main.go +++ b/main.go @@ -64,9 +64,6 @@ func main() { 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 { @@ -74,8 +71,6 @@ func main() { 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()) From 45a4a7e64757595708b5fd76605ec5e55c7ec426 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 17 Apr 2026 17:27:40 +0200 Subject: [PATCH 11/11] fix: fix linting --- action.yml | 2 +- main.go | 10 ++-------- main_test.go | 3 --- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index 41b10f8..7487391 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ inputs: runs: using: 'docker' - image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.2.1' + image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.1.2' # image: 'Dockerfile' args: - ${{ inputs.project }} diff --git a/main.go b/main.go index be6ccd9..7a9eafc 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,6 @@ import ( "bytes" _ "embed" "fmt" - "io" - "log" "net/http" "os" "text/template" @@ -83,12 +81,8 @@ func main() { githubactions.Fatalf("error %s", err.Error()) os.Exit(1) } - defer func(Body io.ReadCloser) { - err := Body.Close() - if err != nil { - log.Fatalln(err) - } - }(resp.Body) + defer resp.Body.Close() //nolint:gocritic + fmt.Println("response Status:", resp.Status) if resp.StatusCode != http.StatusOK { githubactions.Infof("json: %s", jsonStr) diff --git a/main_test.go b/main_test.go index ec0da17..f7e5241 100644 --- a/main_test.go +++ b/main_test.go @@ -113,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) }