Skip to content

Update Solutions Analyzer CSV Files #4

Update Solutions Analyzer CSV Files

Update Solutions Analyzer CSV Files #4

name: Update Solutions Analyzer CSV Files
on:
push:
branches:
- master
paths:
- 'Solutions/**/*.json'
- 'Solutions/**/Parsers/**/*.yaml'
- 'Solutions/**/Parsers/**/*.yml'
- 'Tools/Solutions Analyzer/solution_connector_tables.py'
workflow_dispatch: # Allow manual trigger
schedule:
# Run weekly on Monday at 2 AM UTC to catch any missed changes
- cron: '0 2 * * 1'
jobs:
update-csv:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install json5
- name: Run Solutions Analyzer
run: |
cd "Tools/Solutions Analyzer"
python solution_connector_tables.py
- name: Generate Connector Documentation
run: |
cd "Tools/Solutions Analyzer"
python generate_connector_docs.py
- name: Check for changes
id: check_changes
run: |
if git diff --quiet "Tools/Solutions Analyzer/solutions_connectors_tables_mapping.csv" "Tools/Solutions Analyzer/solutions_connectors_tables_issues_and_exceptions_report.csv" "Tools/Solutions Analyzer/connector-docs/"; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check_changes.outputs.changed == 'true'
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: Update Solutions Analyzer CSV files and documentation'
branch: solutions-analyzer-update
delete-branch: true
title: 'chore: Update Solutions Analyzer CSV files and documentation'
body: |
## Automated Solutions Analyzer Update
This PR contains automated updates to:
- Solutions connector-to-tables mapping CSV
- Solutions issues and exceptions report CSV
- Connector documentation files
Generated by the Solutions Analyzer workflow.
**Triggered by:** ${{ github.event_name }}
**Workflow run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
labels: automated, documentation
add-paths: |
Tools/Solutions Analyzer/solutions_connectors_tables_mapping.csv
Tools/Solutions Analyzer/solutions_connectors_tables_issues_and_exceptions_report.csv
Tools/Solutions Analyzer/connector-docs/
- name: Enable auto-merge
if: steps.check_changes.outputs.changed == 'true' && steps.create_pr.outputs.pull-request-number != ''
run: |
gh pr merge ${{ steps.create_pr.outputs.pull-request-number }} --auto --squash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create summary
if: steps.check_changes.outputs.changed == 'true'
run: |
echo "### Solutions Analyzer Pull Request Created :white_check_mark:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "A pull request has been created with updated CSV files and documentation." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Modified files:**" >> $GITHUB_STEP_SUMMARY
echo "- Tools/Solutions Analyzer/solutions_connectors_tables_mapping.csv" >> $GITHUB_STEP_SUMMARY
echo "- Tools/Solutions Analyzer/solutions_connectors_tables_issues_and_exceptions_report.csv" >> $GITHUB_STEP_SUMMARY
echo "- Tools/Solutions Analyzer/connector-docs/" >> $GITHUB_STEP_SUMMARY
- name: No changes summary
if: steps.check_changes.outputs.changed == 'false'
run: |
echo "### Solutions Analyzer :information_source:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "No changes detected. CSV files and documentation are already up-to-date." >> $GITHUB_STEP_SUMMARY