.github/workflows: Bug fix: Specify a git commit ID

Updates #1664
This commit is contained in:
Hajime Hoshi 2021-08-27 12:39:02 +09:00
parent 4b87d0f783
commit e9a4d99f6a
7 changed files with 11 additions and 6 deletions

View File

@ -26,10 +26,12 @@ import (
"log" "log"
"net/http" "net/http"
"os" "os"
"strings"
"time" "time"
) )
var ( var (
flagCommit = flag.String("commit", "", "git commit hash ID")
flagManifest = flag.String("manifest", "", "manifest file path") flagManifest = flag.String("manifest", "", "manifest file path")
flagNote = flag.String("note", "", "note for the build") flagNote = flag.String("note", "", "note for the build")
) )
@ -101,8 +103,10 @@ func run() error {
return err return err
} }
manifestStr := strings.ReplaceAll(string(manifest), "{{.Commit}}", *flagCommit)
body, err := httpRequest(http.MethodPost, "/api/jobs", &JobRequest{ body, err := httpRequest(http.MethodPost, "/api/jobs", &JobRequest{
Manifest: string(manifest), Manifest: manifestStr,
Note: *flagNote, Note: *flagNote,
}) })
if err != nil { if err != nil {

View File

@ -26,5 +26,6 @@ jobs:
- name: Run - name: Run
run: | run: |
go run .github/workflows/sourcehutbuild.go \ go run .github/workflows/sourcehutbuild.go \
-commit ${{ github.event.head_commit.id }} \
-manifest .github/workflows/sourcehutmanifests/${{ matrix.os }}.yml \ -manifest .github/workflows/sourcehutmanifests/${{ matrix.os }}.yml \
-note '${{ format('{0} ({1})', github.event.head_commit.id, matrix.os) }}' -note '${{ format('{0} ({1})', github.event.head_commit.id, matrix.os) }}'

View File

@ -10,7 +10,7 @@ packages:
- pkgconf - pkgconf
- go - go
sources: sources:
- https://github.com/hajimehoshi/ebiten - https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks: tasks:
- build: | - build: |
cd ebiten cd ebiten

View File

@ -9,7 +9,7 @@ packages:
- pkg-config - pkg-config
- go - go
sources: sources:
- https://github.com/hajimehoshi/ebiten - https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks: tasks:
- build: | - build: |
cd ebiten cd ebiten

View File

@ -12,7 +12,7 @@ packages:
- pkg-config - pkg-config
- golang - golang
sources: sources:
- https://github.com/hajimehoshi/ebiten - https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks: tasks:
- build: | - build: |
cd ebiten cd ebiten

View File

@ -11,7 +11,7 @@ packages:
- pkg-config - pkg-config
- go - go
sources: sources:
- https://github.com/hajimehoshi/ebiten - https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks: tasks:
- build: | - build: |
cd ebiten cd ebiten

View File

@ -12,7 +12,7 @@ packages:
- pkg-config - pkg-config
- golang - golang
sources: sources:
- https://github.com/hajimehoshi/ebiten - https://github.com/hajimehoshi/ebiten#{{.Commit}}
tasks: tasks:
- build: | - build: |
cd ebiten cd ebiten