-
Notifications
You must be signed in to change notification settings - Fork 28
79 lines (69 loc) · 2.06 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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 $(printf "%s" $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 $(printf "%s" $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 }}