Skip to content
Merged
Changes from 10 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
120 changes: 120 additions & 0 deletions .github/workflows/autodoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Autodoc Workflow
#
# This workflow automatically triggers documentation updates for community-supported connectors
# when pull requests are merged 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 merged PRs to master branch
# - Excludes bot-authored PRs 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:
pull_request:
types: [closed]
branches:
- master
Comment on lines 14 to 17
Copy link
Collaborator

@aaronsteers aaronsteers Sep 25, 2025

Choose a reason for hiding this comment

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

Is it reasonable to swap

on:
  pull_request:
    types: [closed]
    branches:
      - master

with

Suggested change
on:
pull_request:
types: [closed]
branches:
- master
on:
push:
branches:
- master


jobs:
update-connector-documentation:
name: Update connector documentation with AI
runs-on: ubuntu-latest
# Only run for merged PRs from the same repo (not forks) and exclude bot authors
if: |
github.event.pull_request.merged == true &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Per prior feedback, if this runs on pushes instead of pull_request triggers, then we could maybe skip this check.

      github.event.pull_request.merged == true && 

github.event.pull_request.head.repo.full_name == github.repository &&
!contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) &&
!endsWith(github.event.pull_request.user.login, '[bot]')

steps:
# Step 1: Get the merged PR code
- name: Checkout merged PR 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 PR
- name: Fetch list of changed files from PR
id: pr-files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🔍 Fetching files changed in PR #${{ github.event.pull_request.number }}..."
FILES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
jq -r '[.[].filename] | @json')

if [ -z "$FILES" ]; then
echo "❌ Error: Failed to fetch or parse PR files."
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're no longer making an API request here, I think we should assume that git diff will almost certainly work. If there is truly a push with 0 files changes, we don't need to exit 1. Exit 0 should be fine, as it doesn't really represent a failure of the workflow.

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 PR affects a community-supported connector
- name: Determine if connector is community-supported
id: check-support-level
run: |
echo "🔍 Checking if PR 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 PR 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"
exit 0

# 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 pull request to review is ${{ github.event.pull_request.number }}"
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