-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
46 lines (43 loc) · 1.21 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: setup-goprivate
# MEMO: Description must be less than 125 characters.
description: "A GitHub Action for configure git config to clone private repositories under `GOPRIVATE`."
author: "hakadoriya"
branding:
icon: search
color: gray-dark
inputs:
goprivate:
description: "GOPRIVATE value"
required: false
default: '' # empty string
token:
description: "GitHub token"
required: true
local:
description: "Whether to configure local git config"
required: false
default: "false"
runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
repository: hakadoriya/git-goprivate
path: ./git-goprivate
- name: Configure .git/config for GOPRIVATE
shell: bash
env:
LOGSH_COLOR: 'true'
GOPRIVATE: ${{ inputs.goprivate }}
GH_TOKEN: ${{ inputs.token }}
run: |
# check GOPRIVATE
if [ -z "${GOPRIVATE:-}" ]; then
export GOPRIVATE=github.com/${{ github.repository_owner }}
fi
# check local or global
if [ "${{ inputs.local }}" = "true" ]; then
./git-goprivate/git-goprivate add --local
else
./git-goprivate/git-goprivate add --global
fi