Update Stats #2
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: Update Stats | |
| on: | |
| schedule: | |
| # Run every Sunday at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-plots: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Clone MultiQC repository | |
| run: git clone https://github.com/MultiQC/MultiQC.git /tmp/multiqc-repo | |
| - name: Generate updated plots | |
| run: uv run generate_plots.py /tmp/multiqc-repo | |
| - name: Check for CSV changes | |
| id: verify-changed-files | |
| run: | | |
| if [ -n "$(git status --porcelain *.csv)" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "CSV files have changed" | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| echo "No changes in CSV files" | |
| fi | |
| - name: Commit and push changes | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add *.svg *.csv | |
| git commit -m "Update MultiQC statistics plots" | |
| git push |