Skip to content

Commit 7fcd7cd

Browse files
authored
Add configure-private-repos action (#1)
* Add configure-private-repos action * minor change
1 parent 763bca5 commit 7fcd7cd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

checkout-with-app/action.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ inputs:
3535
app_pem:
3636
description: 'GitHub App PEM'
3737
required: false
38+
goprivate:
39+
description: 'Comma-separated list of module path prefixes for GOPRIVATE'
40+
required: false
41+
default: ''
3842

3943
outputs:
4044
token:
@@ -71,4 +75,16 @@ runs:
7175
sudo git config --system --add safe.directory '*'
7276
else
7377
git config --system --add safe.directory '*'
74-
fi
78+
fi
79+
80+
- name: Configure Git for private repos
81+
if: inputs.github_app_auth != 'false'
82+
shell: bash
83+
run: |
84+
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"
85+
86+
- name: Configure Go private modules
87+
if: inputs.goprivate != ''
88+
shell: bash
89+
run: |
90+
echo "GOPRIVATE=${{ inputs.goprivate }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)