chore: use image instead of build
All checks were successful
Sample Testing / my_job (push) Successful in 59s

This commit is contained in:
Marcel S. Henselin 2026-04-17 14:57:40 +02:00
parent b375061648
commit 82f727210d
3 changed files with 13 additions and 7 deletions

View file

@ -26,7 +26,7 @@ inputs:
runs: runs:
using: 'docker' using: 'docker'
image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify:v0.1.2' image: 'docker://stackit-solutions.git.onstackit.cloud/actions/notify-slim:v0.1.2'
# image: 'Dockerfile' # image: 'Dockerfile'
args: args:
- ${{ inputs.project }} - ${{ inputs.project }}

View file

@ -1,14 +1,15 @@
FROM golang:1.13 AS builder FROM golang:1.26 AS builder
RUN apt-get update && apt-get -y install upx RUN apt-get update && apt-get -y install upx
WORKDIR /app
#RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action #RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action
#ADD . $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/... # RUN go get -u github.com/sethvargo/go-githubactions/...
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
COPY . . COPY . .
RUN go build \ RUN go mod tidy && go build \
-a \ -a \
-trimpath \ -trimpath \
-ldflags "-s -w -extldflags '-static'" \ -ldflags "-s -w -extldflags '-static'" \

11
main.go
View file

@ -31,6 +31,7 @@ type templateData struct {
Status string Status string
ActionID string ActionID string
GitURL string GitURL string
Project string
Color string Color string
Add string Add string
EventBody string EventBody string
@ -41,6 +42,11 @@ func main() {
data.CardID = uuid.NewString() data.CardID = uuid.NewString()
data.Add = "" data.Add = ""
prj, ok := os.LookupEnv("FORGEJO_REPOSITORY")
if ok {
data.Project = prj
}
author := githubactions.GetInput("author") author := githubactions.GetInput("author")
if author == "" { if author == "" {
githubactions.Infof("[INFO] Missing input 'author', using default") githubactions.Infof("[INFO] Missing input 'author', using default")
@ -150,9 +156,8 @@ func card(d templateData) ([]byte, error) {
if d.EventBody == "" { if d.EventBody == "" {
bdy := "" bdy := ""
prj, ok := os.LookupEnv("FORGEJO_REPOSITORY") if d.Project != "" {
if ok { bdy += fmt.Sprintf("<b>Project:</b> %s<br>", d.Project)
bdy += fmt.Sprintf("<b>Project:</b> %s<br>", prj)
} }
sha, ok := os.LookupEnv("FORGEJO_SHA") sha, ok := os.LookupEnv("FORGEJO_SHA")