Skip to content

Commit

Permalink
fix: check for token before revoking (actions#30)
Browse files Browse the repository at this point in the history
Check before trying to revoke the token, in case the token generation
failed. Otherwise the post step will throw an error.

---------

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
  • Loading branch information
dsanders11 and gr2m committed Aug 28, 2023
1 parent 5611f92 commit 2540ed4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { request } from "@octokit/request";
export async function post(core, request) {
const token = core.getState("token");

if (!token) return;

await request("DELETE /installation/token", {
headers: {
authorization: `token ${token}`,
Expand Down

0 comments on commit 2540ed4

Please sign in to comment.