-
Notifications
You must be signed in to change notification settings - Fork 28
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
1 changed file
with
79 additions
and
0 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,79 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Generate installation access token from PEM key file | ||
run: | | ||
echo "$APP_PRIVATE_KEY" | private_key.pem | ||
./gh-token \ | ||
generate \ | ||
-i "$APP_ID" \ | ||
-k private_key.pem > /dev/null 2 | ||
env: | ||
APP_ID: ${{ secrets.APP_ID }} | ||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: List installations for the app from PEM key file | ||
run: | | ||
echo "$APP_PRIVATE_KEY" | private_key.pem | ||
./gh-token \ | ||
installations \ | ||
-i "$APP_ID" \ | ||
-k private_key.pem > /dev/null 2 | ||
env: | ||
APP_ID: ${{ secrets.APP_ID }} | ||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Generate installation access token with base64 key | ||
run: | | ||
./gh-token \ | ||
generate \ | ||
-i "$APP_ID" \ | ||
-b "$(echo $APP_PRIVATE_KEY | base64)" > /dev/null 2 | ||
env: | ||
APP_ID: ${{ secrets.APP_ID }} | ||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: List installations for the app with base64 key | ||
run: | | ||
./gh-token \ | ||
installations \ | ||
-i "$APP_ID" \ | ||
-b "$(echo $APP_PRIVATE_KEY | base64)" > /dev/null 2 | ||
env: | ||
APP_ID: ${{ secrets.APP_ID }} | ||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Generate then revoke token | ||
run: | | ||
token="$(./gh-token generate -i $APP_ID -b $APP_PRIVATE_KEY)" | ||
./gh-token revoke -t $token | ||
env: | ||
APP_ID: ${{ secrets.APP_ID }} | ||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} |