Skip to content
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e125bb0
feat: Add Autodoc workflow for community connector documentation updates
devin-ai-integration[bot] Sep 21, 2025
5a6c2e9
security: Pin Devin Action to specific commit hash
devin-ai-integration[bot] Sep 21, 2025
5464918
feat: Filter out bot-authored PRs from autodoc workflow
devin-ai-integration[bot] Sep 21, 2025
688bfb3
improve: Enhance Autodoc workflow readability and user experience
devin-ai-integration[bot] Sep 21, 2025
b624218
fix: Apply prettier formatting to resolve Format Check CI failure
devin-ai-integration[bot] Sep 21, 2025
01a621d
security: Pin actions/checkout to specific commit hash
devin-ai-integration[bot] Sep 21, 2025
6b435eb
fix: Use compound variable for prompt-text in Devin Action
devin-ai-integration[bot] Sep 21, 2025
639ac1c
fix: Use official yq installation method via wget
devin-ai-integration[bot] Sep 21, 2025
0c2d81e
fix: Add defensive programming improvements to workflow logic
devin-ai-integration[bot] Sep 21, 2025
b1037a5
fix: Set metadata_file=true when metadata exists but isn't community
devin-ai-integration[bot] Sep 21, 2025
4329e2f
cleanup: Remove redundant exit 0 from skip step
devin-ai-integration[bot] Sep 21, 2025
e3d1bea
Merge branch 'master' into devin/1758418093-autodoc-workflow
ian-at-airbyte Sep 25, 2025
0bcd823
fix: Allow workflow to run for merged PRs from forks
devin-ai-integration[bot] Sep 25, 2025
80717f8
feat: Switch Autodoc workflow trigger from pull_request to push
devin-ai-integration[bot] Sep 26, 2025
37944e7
fix: Remove trailing whitespace to resolve Format Check CI failure
devin-ai-integration[bot] Sep 26, 2025
017dcfa
fix: Change exit 1 to exit 0 when no files changed in push
devin-ai-integration[bot] Sep 27, 2025
e19d6f3
feat: Use github.event.before for more robust file change detection
devin-ai-integration[bot] Sep 27, 2025
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
112 changes: 112 additions & 0 deletions .github/workflows/autodoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Autodoc Workflow
#
# This workflow automatically triggers documentation updates for community-supported connectors
# when changes are pushed to master. It uses Devin AI to review connector changes and
# update the corresponding user documentation to ensure it stays current with code changes.
#
# Workflow triggers:
# - Only on pushes to master branch
# - Excludes bot-authored pushes to prevent automation loops
# - Only processes community-supported connectors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about enabling this also for certified connectors?

Reasoning: Our certified docs aren't always much higher quality than the non-certified connector docs?


name: Autodoc

on:
push:
branches:
- master

jobs:
update-connector-documentation:
name: Update connector documentation with AI
runs-on: ubuntu-latest
# Only run for human authors, exclude bot accounts
if: |
!contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.actor) &&
!endsWith(github.actor, '[bot]')

steps:
# Step 1: Get the pushed code
- name: Checkout pushed code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
fetch-depth: 0 # Full history needed for comprehensive analysis

# Step 2: Analyze what files were changed in this push
- name: Get files changed in this push
id: push-files
run: |
echo "🔍 Fetching files changed in commit ${{ github.sha }}..."
FILES=$(git diff HEAD~1 HEAD --name-only | jq -R -s -c 'split("\n")[:-1]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of

git diff HEAD~1 HEAD --name-only

Would this be more robust in case we ever deal with a rebase or multi-commit situation?

git diff --name-only ${{ github.event.before }} ${{ github.sha }}


if [ -z "$FILES" ] || [ "$FILES" = "[]" ]; then
echo "ℹ️ No files changed in this push - skipping documentation update."
exit 0
fi

echo "✅ Successfully fetched changed files list"
echo "files=$FILES" >> $GITHUB_OUTPUT

# Step 3: Install YAML parsing tool
- name: Install YAML parser (yq)
run: |
echo "📦 Installing yq for metadata.yaml parsing..."
sudo wget https://github.com/mikefarah/yq/releases/download/v4.47.2/yq_linux_amd64 -O /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
echo "✅ yq v4.47.2 installed successfully"

# Step 4: Determine if this push affects a community-supported connector
- name: Determine if connector is community-supported
id: check-support-level
run: |
echo "🔍 Checking if push contains community-supported connector changes..."

# Look for connector metadata files in the standard location
METADATA_FILE=$(find . -path "*/airbyte-integrations/connectors/*/metadata.yaml" | head -n 1)

if [ -z "$METADATA_FILE" ]; then
echo "ℹ️ No connector metadata.yaml file found - this push doesn't affect connectors"
echo "metadata_file=false" >> $GITHUB_OUTPUT
echo "community_support=false" >> $GITHUB_OUTPUT
exit 0
fi

# Parse the support level from the metadata
SUPPORT_LEVEL=$(yq '.data.supportLevel' "$METADATA_FILE")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get-support-level or get-connector-support-level would probably make a good poe command.

echo "📋 Found metadata file: $METADATA_FILE"
echo "📋 Support level: $SUPPORT_LEVEL"

if [ "$SUPPORT_LEVEL" != "community" ]; then
echo "ℹ️ This connector is not community-supported (level: $SUPPORT_LEVEL)"
echo "metadata_file=true" >> $GITHUB_OUTPUT
echo "community_support=false" >> $GITHUB_OUTPUT
exit 0
fi

echo "✅ Community-supported connector detected - documentation update needed"
echo "metadata_file=true" >> $GITHUB_OUTPUT
echo "community_support=true" >> $GITHUB_OUTPUT

# Step 5: Skip documentation update for non-community connectors
- name: Skip documentation update (not community connector)
if: steps.check-support-level.outputs.metadata_file == 'false' || steps.check-support-level.outputs.community_support == 'false'
run: |
echo "⏭️ Skipping documentation update:"
echo " - Metadata file found: ${{ steps.check-support-level.outputs.metadata_file }}"
echo " - Community support: ${{ steps.check-support-level.outputs.community_support }}"
echo " - Only community-supported connectors trigger automatic documentation updates"

# Step 6: Trigger AI documentation update for community connectors
- name: Start AI documentation update session
if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true'
env:
PROMPT_TEXT: "The commit to review is ${{ github.sha }}. This commit was pushed to master and may contain connector changes that need documentation updates."
uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security
with:
devin-token: ${{ secrets.DEVIN_AI_API_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
playbook-macro: "!connectordocs" # Use the connector documentation playbook
prompt-text: ${{ env.PROMPT_TEXT }}
tags: |
area/documentation
team/documentation
Loading