Skip to content

Commit

Permalink
feat: support Github Enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
alozanoff committed Jun 21, 2023
1 parent e8fa997 commit edcce97
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
description: "Github Apps App ID"
private_key:
description: "Github Apps Private Key"
github_url:
description: "Github API URL, for use with Github Enterprise"
default: "https://api.github.com/"

outputs:
app_github_token:
Expand All @@ -25,6 +28,10 @@ runs:
run: |
T=$(mktemp)
trap "rm -f $T" 1 2 3 15
env GITHUB_PRIV_KEY="${{ inputs.private_key }}" go-github-apps -inst-id ${{ inputs.installation_id }} -app-id ${{ inputs.app_id }} > $T
urlparam=""
if [ -n "${{ inputs.github_url }}" ]; then
urlparam="-url ${{ inputs.github_url }}"
fi
env GITHUB_PRIV_KEY="${{ inputs.private_key }}" go-github-apps -inst-id ${{ inputs.installation_id }} -app-id ${{ inputs.app_id }} $urlparam > $T
echo "github_token=$(cat $T)" >> $GITHUB_OUTPUT
shell: bash

0 comments on commit edcce97

Please sign in to comment.