Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,29 @@ jobs:
run: |
OVERLAYS=""

# Function to add overlay path with comma if needed
add_overlay() {
local overlay_path="$1"
if [ -f "$overlay_path" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_path"
else
OVERLAYS="$overlay_path"
fi
fi
}

# Check for doc-specific overlays (list each overlay file individually)
# Check for doc-specific overlays
if [ -d "${{ matrix.doc_id }}/overlays" ]; then
find "${{ matrix.doc_id }}/overlays" -name "*.yaml" -type f | sort | while read overlay_file; do
add_overlay "$overlay_file"
for overlay_file in "${{ matrix.doc_id }}/overlays"/*.yaml; do
if [ -f "$overlay_file" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_file"
else
OVERLAYS="$overlay_file"
fi
fi
done
fi

# Check for shared overlays - only apply to cloud APIs
if [[ "${{ matrix.doc_id }}" == "cloud-"* ]] && [ -d "shared/overlays" ]; then
find "shared/overlays" -name "*.yaml" -type f | sort | while read overlay_file; do
add_overlay "$overlay_file"
for overlay_file in shared/overlays/*.yaml; do
if [ -f "$overlay_file" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_file"
else
OVERLAYS="$overlay_file"
fi
fi
done
fi

Expand Down Expand Up @@ -178,29 +178,29 @@ jobs:
run: |
OVERLAYS=""

# Function to add overlay path with comma if needed
add_overlay() {
local overlay_path="$1"
if [ -f "$overlay_path" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_path"
else
OVERLAYS="$overlay_path"
fi
fi
}

# Check for doc-specific overlays (list each overlay file individually)
# Check for doc-specific overlays
if [ -d "${{ matrix.doc_id }}/overlays" ]; then
find "${{ matrix.doc_id }}/overlays" -name "*.yaml" -type f | sort | while read overlay_file; do
add_overlay "$overlay_file"
for overlay_file in "${{ matrix.doc_id }}/overlays"/*.yaml; do
if [ -f "$overlay_file" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_file"
else
OVERLAYS="$overlay_file"
fi
fi
done
fi

# Check for shared overlays - only apply to cloud APIs
if [[ "${{ matrix.doc_id }}" == "cloud-"* ]] && [ -d "shared/overlays" ]; then
find "shared/overlays" -name "*.yaml" -type f | sort | while read overlay_file; do
add_overlay "$overlay_file"
for overlay_file in shared/overlays/*.yaml; do
if [ -f "$overlay_file" ]; then
if [ -n "$OVERLAYS" ]; then
OVERLAYS="$OVERLAYS,$overlay_file"
else
OVERLAYS="$overlay_file"
fi
fi
done
fi

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/get-cloud-api-spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Fetch and Save Cloud API Spec

on:
workflow_dispatch: # Allows manual trigger of the workflow
repository_dispatch: # Allows other repositories to trigger this workflow
types: [trigger-cloud-api-docs]

jobs:
fetch-and-save-cloud-api-spec:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.RP_AWS_CRED_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
- uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/actions_bot_token
parse-json-secrets: true

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Check out repository
uses: actions/checkout@v4
with:
ref: 'main'
path: redpanda-docs
token: ${{ env.ACTIONS_BOT_TOKEN }}

- name: Get commit SHA and build URL
id: commit-info
run: |
COMMIT_SHA="${{ github.event.client_payload.commit_sha }}"
COMMIT_URL="https://github.com/redpanda-data/cloudv2/commit/${COMMIT_SHA}"
echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV
echo "COMMIT_URL=${COMMIT_URL}" >> $GITHUB_ENV

- name: Install dependencies
run: |
npm install

- name: Run the script and save the output
run: |
npx doc-tools fetch -o redpanda-data -r cloudv2 -p proto/gen/openapi/openapi.controlplane.prod.yaml -d ../../modules/ROOT/attachments cloud-controlplane-api.yaml
npx doc-tools fetch -o redpanda-data -r cloudv2 -p proto/gen/openapi/openapi.dataplane.prod.yaml -d ../../modules/ROOT/attachments cloud-dataplane-api.yaml
env:
VBOT_GITHUB_API_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }}
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "auto-docs: Update Cloud API spec"
token: ${{ env.ACTIONS_BOT_TOKEN }}
path: redpanda-docs
branch: update-branch-api
title: "auto-docs: Update Cloud API spec"
body: |
This PR updates the OpenAPI spec file for the Cloud API.
Triggered by commit: [${{ env.COMMIT_SHA }}](${{ env.COMMIT_URL }})
labels: auto-docs
reviewers: JakeSCahill, kbatuigas
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
2 changes: 1 addition & 1 deletion cloud-controlplane/cloud-controlplane.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
components:
schemas:
AWS.Role:
description: Role identifies AWS role.
description: Role (test) identifies AWS role.
properties:
arn:
description: AWS role ARN.
Expand Down
Loading