diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26a3424..e0877ab 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,5 +12,5 @@ jobs: run: node_modules/.bin/eslint src - name: confirm js artifact matches source run: | - make dist/index.js + make -B dist/index.js git diff --exit-code diff --git a/README.md b/README.md index af954c3..c02b509 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Your customers are deploying to different kinds of hardware, and prototyping on ref: ${{ github.sha }} key-id: ${{ secrets.viam_key_id }} key-value: ${{ secrets.viam_key_value }} + token: ${{ github.token }} # only required for private git repos ``` 1. Add your build commands in your meta.json ([instructions below](#build-commands)). diff --git a/action.yml b/action.yml index ef8aa89..a360271 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,8 @@ inputs: description: Version to set for the module. If missing, your module will build but not upload. ref: description: The git ref to build. This will usually be a sha, but can be a branch or anything supported by git checkout. + token: + description: Pass `github.token` if this is a private repository. runs: using: node20 diff --git a/dist/index.js b/dist/index.js index a7cc0ea..1eb0341 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26968,6 +26968,9 @@ function parseBuildId(stdout) { if (config.ref) { startArgs.push('--ref', config.ref); } + if (getInput('token')) { + startArgs.push('--token', getInput('token')); + } const spawnRet = spawnSync(cliPath, startArgs); checkSpawnSync(spawnRet); const buildId = parseBuildId(spawnRet.stdout); diff --git a/src/index.js b/src/index.js index a3d8751..d099833 100644 --- a/src/index.js +++ b/src/index.js @@ -122,6 +122,9 @@ function parseBuildId(stdout) { if (config.ref) { startArgs.push('--ref', config.ref); } + if (getInput('token')) { + startArgs.push('--token', getInput('token')); + } const spawnRet = spawnSync(cliPath, startArgs); checkSpawnSync(spawnRet); const buildId = parseBuildId(spawnRet.stdout);