-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test Action | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test_action: | ||
name: Run | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get GITHUB_TOKEN for Github Apps | ||
uses: nabeken/go-github-apps@v0 | ||
id: go-github-apps | ||
with: | ||
installation_id: ${{ secrets.installation_id }} | ||
app_id: ${{ secrets.app_id }} | ||
private_key: ${{ secrets.private_key }} | ||
|
||
- name: Test Github API call | ||
run: | | ||
curl --fail -H 'Authorization: token ${{ steps.go-github-apps.outputs.app_github_token }}' https://api.github.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
inputs: | ||
version: | ||
description: "A version to install" | ||
default: "0.1.1" | ||
installation_id: | ||
description: "Github Apps Installation ID" | ||
app_id: | ||
description: "Github Apps App ID" | ||
private_key: | ||
description: "Github Apps Private Key" | ||
|
||
outputs: | ||
app_github_token: | ||
description: "GITHUB_TOKEN for your Github Apps" | ||
value: ${{ steps.go-github-apps.outputs.github_token }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
curl -sSLf https://raw.githubusercontent.com/nabeken/go-github-apps/master/install-via-release.sh | bash -s -- -v v${{ inputs.version }} | ||
sudo cp go-github-apps /usr/local/bin | ||
shell: bash | ||
- id: go-github-apps | ||
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 | ||
echo "::set-output name=github_token::$(cat $T)" | ||
shell: bash |