Skip to content

Commit 2cdcb8b

Browse files
committed
fix(action): handle already expired or revoked token
1 parent e415a9b commit 2cdcb8b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

action/dist/post/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40283,6 +40283,12 @@ runAction(async () => {
4028340283
await github.getOctokit(token)
4028440284
.request('DELETE /installation/token', {
4028540285
headers: { 'X-GitHub-Api-Version': '2022-11-28' },
40286+
}).catch((err) => {
40287+
if (err.response.status === 401) {
40288+
// ignore already expired or revoked token
40289+
return;
40290+
}
40291+
throw err;
4028640292
});
4028740293
}
4028840294
});

action/src/action-post.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ runAction(async () => {
1111
await github.getOctokit(token)
1212
.request('DELETE /installation/token', {
1313
headers: {'X-GitHub-Api-Version': '2022-11-28'},
14+
}).catch((err) => {
15+
if(err.response.status === 401) {
16+
// ignore already expired or revoked token
17+
return;
18+
}
19+
throw err;
1420
});
1521
}
1622
});

0 commit comments

Comments
 (0)