Skip to content

Commit 437d2b0

Browse files
authored
Merge pull request #4 from arkedge/add-extraheader-repos-input
Additional input for config repository specific extraheader
2 parents f5d28b5 + d3f7d5d commit 437d2b0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
endpoint:
77
description: gh-federation lambda endpoint
88
required: true
9+
repos:
10+
description: gh-federation repositories
11+
default: ""
912

1013
runs:
1114
using: "composite"
@@ -36,3 +39,16 @@ runs:
3639
git config --global --add credential.helper store
3740
echo $'protocol=https\nhost=github.com\nusername=x-access-token\npassword='"${GH_FEDERATION_ACCESS_TOKEN}"$'\n' | \
3841
git credential-store store
42+
43+
- name: Store access token for repos as extraheader
44+
if: inputs.repos != ''
45+
shell: bash
46+
env:
47+
REPOS: ${{ inputs.repos }}
48+
run: |
49+
TOKEN=$(echo -n "x-access-token:${GH_FEDERATION_ACCESS_TOKEN}" | base64)
50+
echo "::add-mask::${TOKEN}"
51+
for repo in ${REPOS}; do
52+
echo "config extraheader for ${repo}"
53+
git config --global "http.${GITHUB_SERVER_URL}/${repo}.extraheader" "Authorization: Basic ${TOKEN}"
54+
done

0 commit comments

Comments
 (0)