File tree Expand file tree Collapse file tree 9 files changed +1189
-17
lines changed Expand file tree Collapse file tree 9 files changed +1189
-17
lines changed Original file line number Diff line number Diff line change 52
52
contents : read
53
53
packages : read
54
54
55
+ env :
56
+ DOCKER_IMAGE : ghcr.io/cerberauth/api-vulns-challenges/jwt-strong-eddsa-key:latest
57
+
55
58
steps :
56
59
- name : Checkout
57
60
uses : actions/checkout@v4
@@ -64,16 +67,31 @@ jobs:
64
67
password : ${{ secrets.GITHUB_TOKEN }}
65
68
66
69
- name : Run Server
67
- run : docker run -d -p 8080:8080 ghcr.io/cerberauth/api-vulns-challenges/jwt-strong-eddsa-key:latest
68
-
70
+ run : |
71
+ docker run -d -p 8080:8080 ${{ env.DOCKER_IMAGE }}
72
+ sleep 5
73
+
69
74
- name : Get JWT
70
75
id : get-jwt
71
- run : echo "jwt=$(docker run --rm ghcr.io/cerberauth/api-vulns-challenges/jwt-strong-eddsa-key:latest jwt) >> $GITHUB_OUTPUT
76
+ run : |
77
+ echo "jwt=$(docker run --rm ${{ env.DOCKER_IMAGE }} jwt)" >> $GITHUB_OUTPUT
72
78
73
79
- name : Test CURL Local Action
74
- id : test-curl-action
75
80
uses : ./
76
81
env :
77
82
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78
83
with :
79
- curl : ' curl http://localhost:8080 -H "Authorization: Bearer ${{ steps.get-jwt.outputs.jwt }}" --scans "jwt.*"'
84
+ curl : |
85
+ curl http://localhost:8080 -H "Authorization: Bearer ${{ steps.get-jwt.outputs.jwt }}"
86
+
87
+ - name : Test OpenAPI Local Action
88
+ uses : ./
89
+ env :
90
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91
+ with :
92
+ openapi : ./__tests__/openapi.yaml
93
+
94
+ - name : Stop Server
95
+ if : ${{ always() }}
96
+ run :
97
+ docker stop $(docker ps -q --filter ancestor=${{ env.DOCKER_IMAGE }})
Original file line number Diff line number Diff line change
1
+ openapi : 3.1.0
2
+
3
+ info :
4
+ title : Fake API
5
+ description : A fake API for testing purposes
6
+ version : 1.0.0
7
+ servers :
8
+ - url : http://localhost:8080
9
+ paths :
10
+ /example :
11
+ get :
12
+ summary : Retrieve an example resource
13
+ responses :
14
+ ' 200 ' :
15
+ description : Successful response
16
+ content :
17
+ application/json :
18
+ schema :
19
+ type : object
20
+ components :
21
+ securitySchemes :
22
+ bearerAuth :
23
+ type : http
24
+ scheme : bearer
25
+ bearerFormat : JWT
26
+ security :
27
+ - bearerAuth : []
You can’t perform that action at this time.
0 commit comments