feat: initial implementation #5
2 changed files with 7 additions and 32 deletions
|
@ -1,30 +0,0 @@
|
||||||
const childProcess = require('child_process')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
function runGo() {
|
|
||||||
const goProcess = childProcess.spawnSync(
|
|
||||||
'go',
|
|
||||||
['run', '.'],
|
|
||||||
{
|
|
||||||
cwd: __dirname,
|
|
||||||
stdio: 'inherit',
|
|
||||||
shell: true,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if (goProcess.error) {
|
|
||||||
console.error('Failed to execute `go run .`:', goProcess.error)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (goProcess.status !== 0) {
|
|
||||||
console.error(
|
|
||||||
'`go run .` exited with code',
|
|
||||||
goProcess.status,
|
|
||||||
goProcess.stderr ? goProcess.stderr.toString() : '',
|
|
||||||
)
|
|
||||||
process.exit(goProcess.status)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
runGo()
|
|
9
main.go
9
main.go
|
@ -6,6 +6,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
prTitle := os.Getenv("GITEA_PULL_REQUEST_TITLE")
|
// Get all environment variables
|
||||||
fmt.Println(prTitle)
|
environ := os.Environ()
|
||||||
|
|
||||||
|
// Print each environment variable
|
||||||
|
for _, env := range environ {
|
||||||
|
fmt.Println(env)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue