Example Usage of CodeBoarding Action #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Example Usage of CodeBoarding Action | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| test_repo: | |
| description: 'Repository URL to test with' | |
| required: false | |
| default: 'https://github.com/CodeBoarding/insights-core' | |
| type: string | |
| 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 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Fetch CodeBoarding Documentation | |
| id: codeboarding | |
| uses: ./ # Use the local action (when this is published, users would use: owner/repo@version) | |
| with: | |
| repository_url: ${{ github.repository }} | |
| output_directory: '.codeboarding' | |
| - name: Display Action Results | |
| run: | | |
| echo "Files created: ${{ steps.codeboarding.outputs.files_created }}" | |
| echo "Output directory: ${{ steps.codeboarding.outputs.output_directory }}" | |
| echo "Has changes: ${{ steps.codeboarding.outputs.has_changes }}" | |
| - name: Create Pull Request | |
| if: steps.git-changes.outputs.has_git_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 | |
| - **Files created/updated**: ${{ steps.codeboarding.outputs.files_created }} | |
| - **Output directory**: `${{ steps.codeboarding.outputs.output_directory }}/` | |
| - **Source endpoint**: ${{ vars.CODEBOARDING_ENDPOINT || 'codeboarding endpoint' }} | |
| - **Repository analyzed**: ${{ github.event.inputs.test_repo || github.repository }} | |
| ### π Changes | |
| Files have been updated in the `${{ steps.codeboarding.outputs.output_directory }}/` directory with fresh documentation content. | |
| --- | |
| π€ This PR was automatically generated by the CodeBoarding documentation update workflow. | |
| branch: docs/codeboarding-update | |
| base: main | |
| delete-branch: true |