Skip to content
Merged
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
124 changes: 124 additions & 0 deletions .github/workflows/codeboarding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CodeBoarding Action for RIDE

on:
workflow_dispatch:
inputs:
repository_url:
description: 'Repository URL to test with'
required: false
default: 'https://github.com/robotframework/RIDE'
type: string
source_branch:
description: 'Source branch for comparison'
required: false
default: 'master'
type: string
target_branch:
description: 'Target branch for comparison'
required: false
default: 'develop'
type: string
output_format:
description: 'Output format for documentation'
required: false
default: '.md'
type: string

pull_request:
branches: [ master, develop ]
types: [opened, synchronize, reopened]

schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'

jobs:
update-docs-action-usage:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
timeout-minutes: 60

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Required to access branch history

# Determine branches based on context
- name: Set branch variables
id: set-branches
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "source_branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT
echo "target_branch=${{ github.base_ref }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event.inputs.source_branch }}" != "" ] && [ "${{ github.event.inputs.target_branch }}" != "" ]; then
echo "source_branch=${{ github.event.inputs.source_branch }}" >> $GITHUB_OUTPUT
echo "target_branch=${{ github.event.inputs.target_branch }}" >> $GITHUB_OUTPUT
else
# Default to current branch and main
echo "source_branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "target_branch=main" >> $GITHUB_OUTPUT
fi

- name: Fetch CodeBoarding Documentation
id: codeboarding
uses: ./
with:
repository_url: ${{ github.event.inputs.repository_url }}
source_branch: ${{ steps.set-branches.outputs.source_branch }}
target_branch: ${{ steps.set-branches.outputs.target_branch }}
output_directory: 'doc/.codeboarding'
output_format: ${{ github.event.inputs.output_format || '.md' }}

- name: Display Action Results
run: |
echo "Documentation files created: ${{ steps.codeboarding.outputs.markdown_files_created }}"
echo "JSON files created: ${{ steps.codeboarding.outputs.json_files_created }}"
echo "Documentation directory: ${{ steps.codeboarding.outputs.output_directory }}"
echo "JSON directory: ${{ steps.codeboarding.outputs.json_directory }}"
echo "Has changes: ${{ steps.codeboarding.outputs.has_changes }}"

# Check if we have any changes to commit
- name: Check for changes
id: git-changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "has_git_changes=true" >> $GITHUB_OUTPUT
else
echo "has_git_changes=false" >> $GITHUB_OUTPUT
fi

- name: Create Pull Request
if: steps.git-changes.outputs.has_git_changes == 'true' && steps.codeboarding.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update codeboarding documentation"
title: "📚 CodeBoarding Documentation Update"
body: |
## 📚 Documentation Update

This PR contains updated documentation files fetched from the CodeBoarding service.

### 📊 Summary
- **Documentation files created/updated**: ${{ steps.codeboarding.outputs.markdown_files_created }}
- **JSON files created/updated**: ${{ steps.codeboarding.outputs.json_files_created }}
- **Documentation directory**: `${{ steps.codeboarding.outputs.output_directory }}/`
- **JSON directory**: `${{ steps.codeboarding.outputs.json_directory }}/`
- **Source branch**: `${{ steps.set-branches.outputs.source_branch }}`
- **Target branch**: `${{ steps.set-branches.outputs.target_branch }}`
- **Output format**: `${{ github.event.inputs.output_format || '.md' }}`
- **Repository analyzed**: `${{ steps.codeboarding.outputs.repo_url }}`

### 🔍 Changes
Files have been updated with fresh documentation content based on code changes between branches.

---

🤖 This PR was automatically generated by the CodeBoarding documentation update workflow.
branch: docs/codeboarding-update
base: ${{ steps.set-branches.outputs.target_branch }}
delete-branch: true
Loading