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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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