Skip to content

Commit de1bf43

Browse files
feat: leverage the heroku credential manager for auth (#291)
1 parent 4f26af9 commit de1bf43

File tree

13 files changed

+1940
-1612
lines changed

13 files changed

+1940
-1612
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ jobs:
1111
uses: actions/setup-node@v6
1212
with:
1313
node-version: 22.x
14+
registry-url: https://registry.npmjs.org
1415
cache: npm
1516
- run: npm ci
17+
env:
18+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_HEROKU_CREDENTIAL_MANAGER }}
1619
- name: linting
1720
run: npm run lint
1821

@@ -28,7 +31,11 @@ jobs:
2831
uses: actions/setup-node@v6
2932
with:
3033
node-version: ${{ matrix.node-version }}
34+
registry-url: https://registry.npmjs.org
35+
cache: npm
3136
- run: npm ci
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_HEROKU_CREDENTIAL_MANAGER }}
3239
- name: unit tests
3340
run: npm test
3441
- name: linting

examples/whoami.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class StatusCommand extends Command {
1010

1111
async run() {
1212
if (process.env.HEROKU_API_KEY) this.warn('HEROKU_API_KEY is set')
13-
if (!this.heroku.auth) this.notloggedin()
13+
if (!(await this.heroku.getAuth())) this.notloggedin()
1414
try {
1515
const {body: account} = await this.heroku.get<Heroku.Account>('/account', {retryAuth: false})
1616
ux.stdout(account.email)

0 commit comments

Comments
 (0)