Skip to content

Commit

Permalink
APP-6153 pass checkout token (#5)
Browse files Browse the repository at this point in the history
* try using GITHUB_TOKEN env var

* different env

* more logging to diagnose

* consume token manually

* that was a build error apparently

* rm trace, edit readme

* make artifact match source

* update packages + try again
  • Loading branch information
abe-winter authored Oct 9, 2024
1 parent 344fa43 commit ede2aad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ede2aad

Please sign in to comment.