Skip to content

Commit ede2aad

Browse files
authored
APP-6153 pass checkout token (#5)
* 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
1 parent 344fa43 commit ede2aad

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ jobs:
1212
run: node_modules/.bin/eslint src
1313
- name: confirm js artifact matches source
1414
run: |
15-
make dist/index.js
15+
make -B dist/index.js
1616
git diff --exit-code

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Your customers are deploying to different kinds of hardware, and prototyping on
3333
ref: ${{ github.sha }}
3434
key-id: ${{ secrets.viam_key_id }}
3535
key-value: ${{ secrets.viam_key_value }}
36+
token: ${{ github.token }} # only required for private git repos
3637
```
3738
3839
1. Add your build commands in your meta.json ([instructions below](#build-commands)).

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ inputs:
1515
description: Version to set for the module. If missing, your module will build but not upload.
1616
ref:
1717
description: The git ref to build. This will usually be a sha, but can be a branch or anything supported by git checkout.
18+
token:
19+
description: Pass `github.token` if this is a private repository.
1820

1921
runs:
2022
using: node20

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26968,6 +26968,9 @@ function parseBuildId(stdout) {
2696826968
if (config.ref) {
2696926969
startArgs.push('--ref', config.ref);
2697026970
}
26971+
if (getInput('token')) {
26972+
startArgs.push('--token', getInput('token'));
26973+
}
2697126974
const spawnRet = spawnSync(cliPath, startArgs);
2697226975
checkSpawnSync(spawnRet);
2697326976
const buildId = parseBuildId(spawnRet.stdout);

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ function parseBuildId(stdout) {
122122
if (config.ref) {
123123
startArgs.push('--ref', config.ref);
124124
}
125+
if (getInput('token')) {
126+
startArgs.push('--token', getInput('token'));
127+
}
125128
const spawnRet = spawnSync(cliPath, startArgs);
126129
checkSpawnSync(spawnRet);
127130
const buildId = parseBuildId(spawnRet.stdout);

0 commit comments

Comments
 (0)