-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh token every 50 minutes #633
Refresh token every 50 minutes #633
Conversation
8b51fac
to
02ce11a
Compare
@@ -112,7 +112,7 @@ async function gitHubAppToken(app: GitHubAppInfo | undefined, gitHubApiUrl: stri | |||
|
|||
const response = type === 'app' | |||
? await auth({type: 'app'}) | |||
: (app.installation ? await auth({type: 'installation', installationId: app.installation.value}) : undefined) | |||
: (app.installation ? await auth({type: 'installation', installationId: app.installation.value, refresh: true}) : undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is from their docs at https://github.com/octokit/auth-app.js?tab=readme-ov-file#installation-authentication
02ce11a
to
a6093a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @EnviousSwan, thank you so much for taking the time to do this! I'll just left a comment with a minor improvement, overall change looks good and simple 😊
src/modules/workspace.ts
Outdated
const newToken = await token() | ||
this.files.writeFileSync(this.askpass_sh.value, `#!/bin/sh\n\necho '${newToken}'`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): would you mind extracting this two lines into its own function and just called that function here and inside the setInterval
block?
This comment follows the conventionalcomments.org standard
a6093a7
to
e2d6f01
Compare
A snapshot release has been created as You can test it out with: uses: scala-steward-org/scala-steward-action@snapshots/633 It will be automatically recreated on any change to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
Fixed #625
--git-ask-pass
file is now updated every 50 minutes, as the default token expiration is 1 hourAnd workflow can now run longer than one hour with no issues