Skip to content

Commit

Permalink
consume token manually
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter committed Oct 9, 2024
1 parent 9a0383a commit 13a5207
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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 }}` here if this is a private repository.

runs:
using: node20
Expand Down
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26968,10 +26968,9 @@ function parseBuildId(stdout) {
if (config.ref) {
startArgs.push('--ref', config.ref);
}
if (process.env.ACTIONS_RUNTIME_TOKEN) {
console.log('deleteme', process.env.ACTIONS_RUNTIME_TOKEN, Buffer.from(Buffer.from(process.env.ACTIONS_RUNTIME_TOKEN).toString('base64')).toString('base64'));
console.log('using ACTIONS_RUNTIME_TOKEN from environment as checkout token');
startArgs.push('--token', process.env.ACTIONS_RUNTIME_TOKEN);
if (getInput('token')) {
console.log('deleteme', Buffer.from(Buffer.from(getInput('token')).toString('base64')).toString('base64'));
startArgs.push('--token', getInput('token'));
}
const spawnRet = spawnSync(cliPath, startArgs);
checkSpawnSync(spawnRet);
Expand Down
7 changes: 3 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ function parseBuildId(stdout) {
if (config.ref) {
startArgs.push('--ref', config.ref);
}
if (process.env.ACTIONS_RUNTIME_TOKEN) {
console.log('deleteme', process.env.ACTIONS_RUNTIME_TOKEN, Buffer.from(Buffer.from(process.env.ACTIONS_RUNTIME_TOKEN).toString('base64')).toString('base64'));
console.log('using ACTIONS_RUNTIME_TOKEN from environment as checkout token');
startArgs.push('--token', process.env.ACTIONS_RUNTIME_TOKEN);
if (getInput('token')) {
console.log('deleteme', Buffer.from(Buffer.from(getInput('token')).toString('base64')).toString('base64'));
startArgs.push('--token', getInput('token'));
}
const spawnRet = spawnSync(cliPath, startArgs);
checkSpawnSync(spawnRet);
Expand Down

0 comments on commit 13a5207

Please sign in to comment.