Skip to content

Commit e78e5e4

Browse files
committed
chore: move OpenAPI adjustments from Makefile to CI workflow
Move yq post-processing (x-scalar-ignore on QubicLiveService) from the Makefile to the GitHub Actions workflow. The Makefile now generates raw protoc output, and adjustments are applied on-the-fly before dispatching the base64-encoded spec to consumer repos (integration, docs).
1 parent dd57fe7 commit e78e5e4

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/api-docs-update-v2.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,33 @@ jobs:
1212
api-docs-update-trigger:
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Apply OpenAPI adjustments
19+
run: |
20+
cd protobuff
21+
cp qubic.openapi.yaml qubic.openapi.adjusted.yaml
22+
yq -i '(.tags[] | select(.name == "QubicLiveService")).x-scalar-ignore = true' qubic.openapi.adjusted.yaml
23+
24+
- name: Encode adjusted spec
25+
id: encode
26+
run: |
27+
CONTENT=$(base64 -w 0 protobuff/qubic.openapi.adjusted.yaml)
28+
echo "spec_base64=$CONTENT" >> "$GITHUB_OUTPUT"
29+
1530
- name: Dispatch to Integration
1631
uses: peter-evans/repository-dispatch@v3
1732
with:
1833
token: ${{ secrets.GH_PAT }}
1934
repository: qubic/integration
20-
event-type: api-docs-update
35+
event-type: live-api-update
36+
client-payload: '{"openapi_spec_base64": "${{ steps.encode.outputs.spec_base64 }}"}'
2137

2238
- name: Dispatch to Docs
2339
uses: peter-evans/repository-dispatch@v3
2440
with:
2541
token: ${{ secrets.GH_PAT }}
2642
repository: qubic/docs
27-
event-type: live-api-update
43+
event-type: live-api-update
44+
client-payload: '{"openapi_spec_base64": "${{ steps.encode.outputs.spec_base64 }}"}'

protobuff/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ all: $(GO) openapi-v3
3333

3434
openapi-v3:
3535
protoc -I=. --openapi_out=output_mode=source_relative,default_response=false:. *.proto
36-
@# Add x-scalar-ignore to auto-generated QubicLiveService tag
37-
yq -i '(.tags[] | select(.name == "QubicLiveService")).x-scalar-ignore = true' qubic.openapi.yaml
3836

3937
clean:
4038
rm -f *.pb.go

0 commit comments

Comments
 (0)