diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index e875f26e23d..6f37143b129 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -1,13 +1,13 @@ # Autodoc Workflow # -# This workflow automatically triggers documentation updates for community-supported connectors +# This workflow automatically triggers documentation updates for 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 +# - Processes any connector with metadata.yaml changes name: Autodoc @@ -47,61 +47,31 @@ jobs: echo "✅ Successfully fetched changed files list" echo "files=$FILES" >> $GITHUB_OUTPUT - # Step 3: Install YAML parsing tool - - name: Install YAML parser (yq) + # Step 3: Check if this push affects a connector + - name: Check for connector changes + id: check-connector 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..." + echo "🔍 Checking if push contains connector changes..." # Parse the changed files from Step 2 CHANGED_FILES='${{ steps.push-files.outputs.files }}' - # Filter for connector metadata.yaml files in the changed files - METADATA_FILE=$(echo "$CHANGED_FILES" | yq -p json -r '.[] | select(test("airbyte-integrations/connectors/.*/metadata\\.yaml$"))' | head -n 1) + # Filter for connector metadata.yaml files in the changed files using jq + METADATA_FILE=$(echo "$CHANGED_FILES" | jq -r '.[] | select(test("airbyte-integrations/connectors/.*/metadata\\.yaml$"))' | head -n 1) if [ -z "$METADATA_FILE" ]; then echo "â„šī¸ No connector metadata.yaml file found in changed files - this push doesn't affect connectors" - echo "metadata_file=false" >> $GITHUB_OUTPUT - echo "community_support=false" >> $GITHUB_OUTPUT + echo "connector_changed=false" >> $GITHUB_OUTPUT exit 0 fi - # Parse the support level from the metadata - SUPPORT_LEVEL=$(yq '.data.supportLevel' "$METADATA_FILE") - echo "📋 Found metadata file: $METADATA_FILE" - echo "📋 Support level: $SUPPORT_LEVEL" + echo "📋 Found connector metadata file: $METADATA_FILE" + echo "✅ Connector change detected - documentation update needed" + echo "connector_changed=true" >> $GITHUB_OUTPUT - 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 + # Step 4: Trigger AI documentation update for connector changes - name: Start AI documentation update session - if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' + if: steps.check-connector.outputs.connector_changed == '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