fix: fix params
Some checks failed
Sample Testing / my_job (push) Failing after 2m44s

This commit is contained in:
Marcel S. Henselin 2026-04-17 14:39:47 +02:00
parent c9f0fc3d86
commit 8f1877086c
4 changed files with 10 additions and 122 deletions

5
.dockerignore Normal file
View file

@ -0,0 +1,5 @@
.github
.gitignore
action.yml
docker-slimbuild
main_test.go

14
main.go
View file

@ -64,8 +64,11 @@ func main() {
status := githubactions.GetInput("status")
if status == "" {
githubactions.Fatalf("Missing input 'status'")
os.Exit(1)
githubactions.Infof("[INFO] Missing input 'status', trying default")
var ok bool
if status, ok = os.LookupEnv("JOB_STATUS"); ok {
githubactions.Infof("[INFO] found job status")
}
}
data.Status = status
@ -162,13 +165,6 @@ func card(d templateData) ([]byte, error) {
bdy += fmt.Sprintf("<b>Branch:</b> <font color='#00FF00f'>%s</font><br>", ref)
}
if d.Status == "" {
stat, ok := os.LookupEnv("JOB_STATUS")
if ok {
d.Status = stat
}
}
if d.Status != "" {
bdy += fmt.Sprintf("<b>Build Status:</b> <font color='#0000ff'>%s</font>", d.Status)
}

View file

@ -1,35 +0,0 @@
{
"cards": [
{
"header": {
"title": "{{ .Title }}",
"subtitle": "{{ .SubTitle }}",
"imageUrl": "{{ .IconUrl }}",
"imageStyle": "IMAGE"
},
"sections": [
{
"widgets": [
{
"textParagraph": {
"text": "<b>Project:</b> {{ .Project }}<br><b>Commit-id:</b> <font color=\"#FF0000\">{{ .Commit }}</font><br><b>Branch:</b> <font color=\"#00FF00f\">{{ .Branch }}</font><br><b>Build Status:</b> <font color=\"#0000ff\">{{ .Status }}</font>"
},
"buttons": [
{
"textButton": {
"text": "Job Details",
"onClick": {
"openLink": {
"url": "{{ .GitURL }}/{{ .Project }}/actions/runs/{{ .ActionID }}"
}
}
}
}
]
}
]
}
]
}
]
}

View file

@ -1,78 +0,0 @@
{
"cardsV2": [
{
"cardId": "unique-card-id",
"card": {
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"imageType": "CIRCLE",
"imageAltText": "Avatar for Sasha"
},
"sections": [
{
"header": "Contact Info",
"collapsible": true,
"uncollapsibleWidgetsCount": 1,
"widgets": [
{
"decoratedText": {
"startIcon": {
"knownIcon": "EMAIL"
},
"text": "sasha@example.com"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PERSON"
},
"text": "<font color=\"#80e27e\">Online</font>"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PHONE"
},
"text": "+1 (555) 555-1234"
}
},
{
"buttonList": {
"buttons": [
{
"text": "Share",
"onClick": {
"openLink": {
"url": "https://example.com/share"
}
}
},
{
"text": "Edit",
"onClick": {
"action": {
"function": "goToView",
"parameters": [
{
"key": "viewType",
"value": "EDIT"
}
]
}
}
}
]
}
}
]
}
]
}
}
]
}