Skip to content
Closed
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
51 changes: 51 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Reusable workflow: Publish connector docs to registry on release.
# BLOCKED: Registry deployment required before activation.
name: Publish Connector Docs

on:
workflow_call:
inputs:
tag:
required: true
type: string
description: "Release tag (semver)"
secrets:
RELENG_GITHUB_TOKEN:
required: true
# TODO: Add registry API authentication secret when deployed
REGISTRY_API_TOKEN:
required: true

jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout connector repo
uses: actions/checkout@v5
with:
repository: ${{ github.event.repository.full_name }}
ref: ${{ inputs.tag }}

- name: Check for connector docs
id: check-docs
run: |
if [ -f docs/connector.mdx ]; then
echo "has_docs=true" >> "$GITHUB_OUTPUT"
else
echo "has_docs=false" >> "$GITHUB_OUTPUT"
echo "::notice::No docs/connector.mdx found. Skipping doc publishing."
fi

- name: Publish docs to registry
if: steps.check-docs.outputs.has_docs == 'true'
env:
CONNECTOR_NAME: ${{ github.event.repository.name }}
TAG: ${{ inputs.tag }}
# TODO: Set REGISTRY_API_URL when registry is deployed
# REGISTRY_API_URL: https://registry-api.conductorone.com
run: |
# TODO: Set REGISTRY_API_URL when registry is deployed
curl -X POST "${REGISTRY_API_URL}/v1/connectors/${CONNECTOR_NAME}/versions/${TAG}/docs" \
-H "Authorization: Bearer ${REGISTRY_API_TOKEN}" \
-H "Content-Type: application/json" \
-d @<(jq -n --arg doc "$(cat docs/connector.mdx)" '{"documentation": $doc}')
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,16 @@ jobs:
run: |
./scripts/validate-release-artifacts.sh "$ORG_REPO" "$VERSION"

# TODO: Activate when registry is deployed. Currently scaffolded only.
publish-docs:
needs: [record-connector-registry]
if: always() && needs.record-connector-registry.result == 'success'
uses: ConductorOne/github-workflows/.github/workflows/publish-docs.yaml@main
with:
tag: ${{ inputs.tag }}
secrets:
RELENG_GITHUB_TOKEN: ${{ secrets.RELENG_GITHUB_TOKEN }}

notify-release-failure:
needs:
[
Expand Down