Compare commits
No commits in common. "v0.2.0" and "v0.1.2" have entirely different histories.
11 changed files with 65 additions and 274 deletions
24
.github/workflows/example.yml
vendored
24
.github/workflows/example.yml
vendored
|
|
@ -1,38 +1,34 @@
|
||||||
name: Sample Testing
|
name: Sample Testing
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
env:
|
|
||||||
VER: 0.1.2
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
my_job:
|
my_job:
|
||||||
runs-on: stackit-docker
|
runs-on: stackit-docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Get commit hash
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: echo "::set-output name=sha8::$(echo ${FORGEJO_SHA} | cut -c1-8)"
|
||||||
|
id: slug
|
||||||
|
|
||||||
- name: First Chat Message
|
- name: First Chat Message
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v${{ env.VER }}
|
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.1.2
|
||||||
with:
|
with:
|
||||||
title: "[START] sample test (${{ forgejo.run_number }})"
|
|
||||||
author: ${{ forgejo.actor }}
|
author: ${{ forgejo.actor }}
|
||||||
giturl: ${{ forgejo.server_url }}
|
giturl: ${{ forgejo.server_url }}
|
||||||
iconslug: instacart
|
# status: ${{ job.status }}
|
||||||
# status: ${{ job.status }} # optional
|
|
||||||
actionid: ${{ forgejo.run_number }}
|
actionid: ${{ forgejo.run_number }}
|
||||||
webhook: "${{ secrets.WEBHOOK_URL }}"
|
webhook: "${{ secrets.WEBHOOK_URL }}"
|
||||||
# event_body: "" # optional
|
# event_body: "" # optional
|
||||||
|
|
||||||
- name: Force failure
|
|
||||||
run: |
|
|
||||||
echo "This is a force failure"
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Second Chat Message as ThreadResponse
|
- name: Second Chat Message as ThreadResponse
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.1.2
|
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.1.2
|
||||||
with:
|
with:
|
||||||
title: "[END] sample test (${{ forgejo.run_number }})"
|
|
||||||
iconslug: bun
|
|
||||||
author: ${{ forgejo.actor }}
|
author: ${{ forgejo.actor }}
|
||||||
giturl: ${{ forgejo.server_url }}
|
giturl: ${{ forgejo.server_url }}
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
|
|
|
||||||
102
.github/workflows/release.yml
vendored
102
.github/workflows/release.yml
vendored
|
|
@ -1,102 +0,0 @@
|
||||||
name: CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
# If a 403 error occurs, make sure to set content permission to write
|
|
||||||
# see: https://github.com/go-semantic-release/action/issues/27
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: stackit-docker
|
|
||||||
steps:
|
|
||||||
- name: CI checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup GO
|
|
||||||
uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version: 1.26
|
|
||||||
|
|
||||||
- name: GO Linting
|
|
||||||
uses: golangci/golangci-lint-action@v3
|
|
||||||
|
|
||||||
# build:
|
|
||||||
# runs-on: stackit-docker
|
|
||||||
## strategy:
|
|
||||||
## fail-fast: true
|
|
||||||
## matrix:
|
|
||||||
## node: [10, 12]
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v6
|
|
||||||
#
|
|
||||||
# - uses: actions/setup-node@v1
|
|
||||||
# with:
|
|
||||||
# node-version: ${{ matrix.node }}
|
|
||||||
# - run: npm ci
|
|
||||||
# - run: npm test
|
|
||||||
release:
|
|
||||||
runs-on: stackit-docker
|
|
||||||
# needs: build
|
|
||||||
outputs:
|
|
||||||
tag: ${{ steps.create_release.outputs.tag }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
# - name: Semantic Release
|
|
||||||
# uses: go-semantic-release/action@v1
|
|
||||||
# id: semrel
|
|
||||||
# with:
|
|
||||||
# github-token: ${{ env.FORGEJO_TOKEN }}
|
|
||||||
# allow-initial-development-versions: true
|
|
||||||
# # update-file: package.json
|
|
||||||
# changelog-file: CHANGELOG.md
|
|
||||||
# changelog-generator-opt: "emojis=true"
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
env:
|
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
||||||
id: create_release
|
|
||||||
run: |
|
|
||||||
npx \
|
|
||||||
-p semantic-release \
|
|
||||||
-p @semantic-release/commit-analyzer \
|
|
||||||
-p @semantic-release/release-notes-generator \
|
|
||||||
-p @semantic-release/changelog \
|
|
||||||
-p @semantic-release/git \
|
|
||||||
semantic-release
|
|
||||||
echo "tag=$(git describe --tags --abbrev=0)" >> $FORGEJO_OUTPUT
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
if: steps.create_release.outputs.tag != ''
|
|
||||||
uses: docker/login-action@v4
|
|
||||||
with:
|
|
||||||
registry: ${{ forgejo.server_url }}
|
|
||||||
username: ${{ vars.GIT_USERNAME }}
|
|
||||||
password: ${{ secrets.GIT_PAT }}
|
|
||||||
|
|
||||||
# - name: Set up QEMU
|
|
||||||
# if: steps.semrel.outputs.version != ''
|
|
||||||
# uses: docker/setup-qemu-action@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
if: steps.create_release.outputs.tag != ''
|
|
||||||
uses: docker/setup-buildx-action@v4
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v7
|
|
||||||
with:
|
|
||||||
push: false
|
|
||||||
tags: actions/notify-slim:${{ steps.create_release.outputs.tag }}
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
version: "2"
|
|
||||||
run:
|
|
||||||
concurrency: 4
|
|
||||||
output:
|
|
||||||
formats:
|
|
||||||
text:
|
|
||||||
print-linter-name: true
|
|
||||||
print-issued-lines: true
|
|
||||||
colors: true
|
|
||||||
path: stdout
|
|
||||||
linters:
|
|
||||||
enable:
|
|
||||||
- bodyclose
|
|
||||||
- depguard
|
|
||||||
- errorlint
|
|
||||||
- forcetypeassert
|
|
||||||
- gochecknoinits
|
|
||||||
- gocritic
|
|
||||||
- gosec
|
|
||||||
- misspell
|
|
||||||
- nakedret
|
|
||||||
- revive
|
|
||||||
- sqlclosecheck
|
|
||||||
- wastedassign
|
|
||||||
disable:
|
|
||||||
- noctx
|
|
||||||
- unparam
|
|
||||||
settings:
|
|
||||||
depguard:
|
|
||||||
rules:
|
|
||||||
main:
|
|
||||||
list-mode: original
|
|
||||||
allow: []
|
|
||||||
deny:
|
|
||||||
- pkg: github.com/stretchr/testify
|
|
||||||
desc: Do not use a testing framework
|
|
||||||
gocritic:
|
|
||||||
disabled-checks:
|
|
||||||
- wrapperFunc
|
|
||||||
- typeDefFirst
|
|
||||||
- ifElseChain
|
|
||||||
- dupImport
|
|
||||||
- hugeParam
|
|
||||||
enabled-tags:
|
|
||||||
- performance
|
|
||||||
- style
|
|
||||||
- experimental
|
|
||||||
gosec:
|
|
||||||
excludes:
|
|
||||||
- G104
|
|
||||||
- G102
|
|
||||||
- G304
|
|
||||||
- G307
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
nakedret:
|
|
||||||
max-func-lines: 0
|
|
||||||
revive:
|
|
||||||
severity: error
|
|
||||||
rules:
|
|
||||||
- name: errorf
|
|
||||||
- name: context-as-argument
|
|
||||||
- name: error-return
|
|
||||||
- name: increment-decrement
|
|
||||||
- name: indent-error-flow
|
|
||||||
- name: superfluous-else
|
|
||||||
- name: unused-parameter
|
|
||||||
- name: unreachable-code
|
|
||||||
- name: atomic
|
|
||||||
- name: empty-lines
|
|
||||||
- name: early-return
|
|
||||||
exclusions:
|
|
||||||
paths:
|
|
||||||
- generator/
|
|
||||||
- internal/testutils
|
|
||||||
generated: lax
|
|
||||||
warn-unused: true
|
|
||||||
# Excluding configuration per-path, per-linter, per-text and per-source.
|
|
||||||
rules:
|
|
||||||
# Exclude some linters from running on tests files.
|
|
||||||
- path: _test\.go
|
|
||||||
linters:
|
|
||||||
- gochecknoinits
|
|
||||||
formatters:
|
|
||||||
enable:
|
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
# settings:
|
|
||||||
# goimports:
|
|
||||||
# local-prefixes:
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"branches": ["main"],
|
|
||||||
"tagFormat": "v${version}",
|
|
||||||
"plugins": [
|
|
||||||
"@semantic-release/commit-analyzer",
|
|
||||||
"@semantic-release/release-notes-generator",
|
|
||||||
"@semantic-release/changelog",
|
|
||||||
"@semantic-release/git"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
# [0.2.0](https://stackit-solutions.git.onstackit.cloud/actions/notify/compare/v0.1.2...v0.2.0) (2026-04-17)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* linting ([9d4e8c9](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/9d4e8c9a9dc3fcc133299e978fed191ad6052aac))
|
|
||||||
* linting ([5b93809](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/5b938091d705e01f6467cdd6be9144e491c66502))
|
|
||||||
* pipeline container build ([0414cf6](https://stackit-solutions.git.onstackit.cloud/actions/notify/commit/0414cf6dfb9956c85bb48f5217806841f5819716))
|
|
||||||
29
Dockerfile
29
Dockerfile
|
|
@ -1,29 +1,10 @@
|
||||||
FROM golang:1.26 AS builder
|
FROM golang:1.26
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y install upx
|
WORKDIR /src
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN go mod tidy && go build \
|
RUN go get -u github.com/sethvargo/go-githubactions/... \
|
||||||
-a \
|
&& go mod tidy \
|
||||||
-trimpath \
|
&& go build -o /bin/google-chat-action
|
||||||
-ldflags "-s -w -extldflags '-static'" \
|
|
||||||
-installsuffix cgo \
|
|
||||||
-tags netgo \
|
|
||||||
-o /bin/google-chat-action \
|
|
||||||
.
|
|
||||||
|
|
||||||
RUN strip /bin/google-chat-action
|
|
||||||
|
|
||||||
RUN upx -q -9 /bin/google-chat-action
|
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
||||||
|
|
||||||
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/google-chat-action"]
|
ENTRYPOINT ["/bin/google-chat-action"]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
FROM golang:1.26
|
|
||||||
|
|
||||||
WORKDIR /src
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN go get -u github.com/sethvargo/go-githubactions/... \
|
|
||||||
&& go mod tidy \
|
|
||||||
&& go build -o /bin/google-chat-action
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/google-chat-action"]
|
|
||||||
31
README.md
31
README.md
|
|
@ -13,20 +13,23 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# ... all your steps
|
- name: Checkout
|
||||||
- name: Sample Chat Message
|
uses: actions/checkout@v6
|
||||||
if: ${{ always() }} # runs als after fails
|
|
||||||
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0.1.2
|
- name: Get commit hash
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||||
|
id: slug
|
||||||
|
|
||||||
|
- name: Chat Setup
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: https://stackit-solutions.git.onstackit.cloud/actions/notify@v0
|
||||||
with:
|
with:
|
||||||
title: "[START] sample test (${{ forgejo.run_number }})"
|
project: ${{ github.repository }}
|
||||||
author: ${{ forgejo.actor }}
|
commit: ${{ steps.slug.outputs.sha8 }}
|
||||||
giturl: ${{ forgejo.server_url }}
|
branch: ${{ github.ref }}
|
||||||
iconslug: instacart # optional
|
status: ${{ job.status }}
|
||||||
# status: ${{ job.status }} # optional
|
actionid: ${{ github.repository }}/runs/${{ github.run_id }}
|
||||||
actionid: ${{ forgejo.run_number }}
|
webhook: "https://chat.googleapis.com/v1/spaces/AAAAzPcAy4s/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=MmdzluicdrdkyUAV_QwB6BzlLcIhbfrwNzxVrEllaec%3D&threadKey=git-commit"
|
||||||
webhook: "${{ secrets.WEBHOOK_URL }}"
|
|
||||||
event_body: "This is a sample <b>TEXT</b><br>with a new line" # optional
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO - icon_slug
|
|
||||||
|
|
|
||||||
31
docker-slimbuild
Normal file
31
docker-slimbuild
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
FROM golang:1.26 AS builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get -y install upx
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
#RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action
|
||||||
|
#ADD . $GOPATH/src/github.com/DTherHtun/google-chat-action
|
||||||
|
# RUN go get -u github.com/sethvargo/go-githubactions/...
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go mod tidy && go build \
|
||||||
|
-a \
|
||||||
|
-trimpath \
|
||||||
|
-ldflags "-s -w -extldflags '-static'" \
|
||||||
|
-installsuffix cgo \
|
||||||
|
-tags netgo \
|
||||||
|
-o /bin/google-chat-action \
|
||||||
|
.
|
||||||
|
|
||||||
|
RUN strip /bin/google-chat-action
|
||||||
|
|
||||||
|
RUN upx -q -9 /bin/google-chat-action
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
||||||
|
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/google-chat-action"]
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 48 KiB |
|
|
@ -27,7 +27,7 @@
|
||||||
{
|
{
|
||||||
"textParagraph": {
|
"textParagraph": {
|
||||||
"text": "{{ .EventBody }}",
|
"text": "{{ .EventBody }}",
|
||||||
"maxLines": 5
|
"maxLines": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue