Skip to content

Commit cb94dad

Browse files
authored
Merge pull request #1510 from gardener/zkdev-trusted-checkout-host-input
enh: Allow `trusted-checkout` action user to set github-server-url
2 parents 5b00dbf + 7505d12 commit cb94dad

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/actions/github-auth/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ runs:
7474
if ${{ inputs.host != '' }}; then
7575
host="${{ inputs.host }}"
7676
else
77-
server_url="${{ github.server_url }}"
78-
host="${server_url#*://}"
77+
host="${{ github.server_url }}"
7978
fi
79+
host="${host#*://}"
8080
8181
if ${{ inputs.organization != '' }}; then
8282
organization="${{ inputs.organization }}"

.github/actions/trusted-checkout/action.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ inputs:
102102
description: |
103103
Input is passed to `github-auth` action as `permissions` input. Hence it is only considered if
104104
`token-server` input is set as well.
105+
github-server-url:
106+
type: string
107+
required: false
108+
description: |
109+
Input is passed to `github-auth` action as `host`, and checkout action as `github-server-url`
110+
input. Example URLs are
111+
"https://github.com" or "https://my-ghes-server.example.com"
105112
init-git-identity:
106113
type: boolean
107114
default: false
@@ -146,6 +153,7 @@ runs:
146153
organization: ${{ steps.preprocess.outputs.org }}
147154
repositories: ${{ steps.preprocess.outputs.repo }}
148155
permissions: ${{ inputs.github-auth-token-permissions }}
156+
host: ${{ inputs.github-server-url }}
149157

150158
- name: create-token-via-github-app
151159
if: ${{ inputs.auth-app-private-key != '' && inputs.token-server == '' }}
@@ -198,6 +206,7 @@ runs:
198206
path: ${{ inputs.path }}
199207
repository: ${{ steps.preprocess.outputs.org }}/${{ steps.preprocess.outputs.repo }}
200208
ref: ${{ inputs.ref }}
209+
github-server-url: ${{ inputs.github-server-url }}
201210

202211
- uses: actions/checkout@v6
203212
if: ${{ steps.token.outputs.token != '' }}
@@ -207,6 +216,7 @@ runs:
207216
repository: ${{ steps.preprocess.outputs.org }}/${{ steps.preprocess.outputs.repo }}
208217
ref: ${{ inputs.ref }}
209218
token: ${{ steps.token.outputs.token }}
219+
github-server-url: ${{ inputs.github-server-url }}
210220

211221
- name: checkout-submodules
212222
if: ${{ inputs.submodules == 'recursive' }}

0 commit comments

Comments
 (0)