Skip to content

Commit

Permalink
fix: generate uuid for service instance id on linux
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Dec 4, 2023
1 parent 729d87f commit cc88fd1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@
"@bufbuild/protoc-gen-es": "^1.5.0",
"@connectrpc/connect": "^1.1.3",
"@connectrpc/protoc-gen-connect-es": "^1.1.3",
"octokit": "^3.1.2"
"octokit": "^3.1.2",
"uuid": "^9.0.1"
},
"devDependencies": {
"@connectrpc/connect-node": "^1.1.3",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.0",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vercel/ncc": "^0.38.1",
Expand Down
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import * as io from '@actions/io'
import childProcess, { StdioOptions } from 'node:child_process'
import { v4 as uuidv4 } from 'uuid'

import * as core from '@actions/core'
import * as exec from '@actions/exec'
Expand Down Expand Up @@ -234,7 +235,7 @@ export async function agentInstall(): Promise<boolean> {
const isLinux = process.platform !== 'win32' && process.platform !== 'darwin'
if (isLinux) {
// @TODO fix: write a service ID which is temporary
fs.writeFileSync('/var/tmp/buildless/buildless-service.id', 'ephemeral-gha')
fs.writeFileSync('/var/tmp/buildless/buildless-service.id', uuidv4())
return true
} else {
return (
Expand Down

0 comments on commit cc88fd1

Please sign in to comment.