Skip to content
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

Conversation

EnviousSwan
Copy link
Contributor

Fixed #625

--git-ask-pass file is now updated every 50 minutes, as the default token expiration is 1 hour

image

And workflow can now run longer than one hour with no issues

image

@@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-actions bot added a commit that referenced this pull request Sep 7, 2024
github-actions bot added a commit that referenced this pull request Sep 7, 2024
Copy link
Member

@alejandrohdezma alejandrohdezma left a 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 😊

Comment on lines 125 to 126
const newToken = await token()
this.files.writeFileSync(this.askpass_sh.value, `#!/bin/sh\n\necho '${newToken}'`)
Copy link
Member

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

Copy link
Contributor

github-actions bot commented Sep 8, 2024

Code Coverage

Package Line Rate Branch Rate Complexity Health
core 100% 100% 0
modules 69% 88% 0
Summary 71% (488 / 692) 89% (74 / 83) 0

github-actions bot added a commit that referenced this pull request Sep 8, 2024
Copy link
Contributor

github-actions bot commented Sep 8, 2024

A snapshot release has been created as snapshots/633.

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.

Copy link
Member

@alejandrohdezma alejandrohdezma left a 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!

@alejandrohdezma alejandrohdezma merged commit 74a9a67 into scala-steward-org:master Sep 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App token seems to expire after 1h
2 participants