-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functionality to configure access to internal and private reposit…
…ories (#55) * Add functionality to configure access to internal and private repositories. Uses optional secret to pass the token.
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
on: | ||
workflow_call: | ||
secrets: | ||
GITHUB_OAUTH_TOKEN: | ||
required: false | ||
inputs: | ||
config-name: | ||
type: string | ||
|
@@ -77,6 +80,13 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
go-version-file: "${{ inputs.project-path }}/go.mod" | ||
- name: Configure access to internal and private GitHub repos | ||
run: | | ||
if [ -n "${{ secrets.GITHUB_OAUTH_TOKEN }}" ]; then | ||
git config --global url."https://${{ secrets.GITHUB_OAUTH_TOKEN }}:[email protected]/coopnorge".insteadOf "https://github.com/coopnorge"; | ||
else | ||
echo "GITHUB_OAUTH_TOKEN is not set. Skipping Git configuration."; | ||
fi | ||
- name: Install API DIff | ||
run: go install golang.org/x/exp/cmd/apidiff@latest | ||
- name: Get PR diff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,13 +57,18 @@ jobs: | |
uses: coopnorge/github-workflow-release-drafter/.github/workflows/[email protected] | ||
with: | ||
project-path: "./go-playground" | ||
secrets: | ||
GITHUB_OAUTH_TOKEN: ${{ secrets.OUR_GITHUB_TOKEN }} | ||
``` | ||
**NOTE:** As we generally have projects inside subdirectories, we need to | ||
specify the `project-path`. | ||
|
||
**NOTE:** Make sure to request permissions | ||
|
||
**NOTE:** GITHUB_OAUTH_TOKEN should be supplied if you reference other | ||
internal/private repositories | ||
|
||
```yaml | ||
pull-requests: write | ||
contents: write | ||
|