Skip to content

Commit

Permalink
Updating handling of revocation if a token was not issued
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-murray authored Jan 29, 2024
1 parent 8ef669e commit 4c345ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/post/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions post.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ const core = require('@actions/core')
;

async function revokeToken() {
const token = core.getState('token');

if (!token) {
core.info(`There is no valid token stored in the action state, nothing to revoke.`);
return;
}

try {
const revokeToken = core.getBooleanInput('revoke_token');
if (revokeToken) {
core.info(`GitHub Application token revocation being performed...`);

const baseUrl = core.getInput('github_api_base_url');
const proxy = core.getInput('https_proxy')
const token = core.getState('token');

const revoked = await githubApplication.revokeAccessToken(token, baseUrl, proxy);
if (revoked) {
core.info(` token has been revoked.`)
Expand Down

0 comments on commit 4c345ad

Please sign in to comment.