Skip to content

feat(config): Try SCOOP_GH_TOKEN value first before gh_token value from config#4842

Merged
niheaven merged 1 commit intodevelopfrom
unknown repository
Mar 26, 2022
Merged

feat(config): Try SCOOP_GH_TOKEN value first before gh_token value from config#4842
niheaven merged 1 commit intodevelopfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 25, 2022

Description

There are multiple usages of GitHub token value in the scoop (in checkver.ps1, core.ps1, install.ps1), but only in once place (in checkver.ps1), there is a logic to try using token value from SCOOP_GH_TOKEN environment variable first. This PR unifies the token value obtain logic and puts it into the function, which is used everywhere token value is needed.

Motivation

Using token in environment variable is needed for GitHub Actions setup (I am setting up GitHub Actions for private bucket right now and token is required for accessing artifacts located in private repository).

How Has This Been Tested?

Tested with private GitHub repositories using both gh_token and SCOOP_GH_TOKEN values.

Checklist:

  • I have read the Contributing Guide.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@ghost ghost changed the title Scoop gh token feat: try SCOOP_GH_TOKEN value first before gh_token value from config Mar 25, 2022
@ghost ghost changed the title feat: try SCOOP_GH_TOKEN value first before gh_token value from config feat(config): try SCOOP_GH_TOKEN value first before gh_token value from config Mar 25, 2022
@rashil2000 rashil2000 requested a review from niheaven March 25, 2022 20:48
Copy link
Copy Markdown
Member

@rasa rasa left a comment

Choose a reason for hiding this comment

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

Untested but LGTM

@niheaven niheaven changed the title feat(config): try SCOOP_GH_TOKEN value first before gh_token value from config feat(config): Try SCOOP_GH_TOKEN value first before gh_token value from config Mar 26, 2022
@niheaven niheaven merged commit f441968 into ScoopInstaller:develop Mar 26, 2022
@ghost ghost deleted the scoop_gh_token branch March 26, 2022 16:58
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.

3 participants