Skip to content

Commit 7c23cae

Browse files
fix: parse args before passing them to exec
1 parent 196fa9c commit 7c23cae

File tree

9 files changed

+1189
-17
lines changed

9 files changed

+1189
-17
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
contents: read
5353
packages: read
5454

55+
env:
56+
DOCKER_IMAGE: ghcr.io/cerberauth/api-vulns-challenges/jwt-strong-eddsa-key:latest
57+
5558
steps:
5659
- name: Checkout
5760
uses: actions/checkout@v4
@@ -64,16 +67,31 @@ jobs:
6467
password: ${{ secrets.GITHUB_TOKEN }}
6568

6669
- 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+
6974
- name: Get JWT
7075
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
7278
7379
- name: Test CURL Local Action
74-
id: test-curl-action
7580
uses: ./
7681
env:
7782
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7883
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 }})

__tests__/openapi.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: []

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)