Sync IUC Tools #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: Sync IUC Tools | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: 'Force sync even if an open PR already exists' | |
| type: boolean | |
| default: false | |
| schedule: | |
| - cron: '0 8 * * 5' | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| pr_number: ${{ steps.find_pr.outputs.number }} | |
| steps: | |
| - name: Check if sync PR already exists | |
| id: find_pr | |
| uses: juliangruber/find-pull-request-action@v1 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: sync-iuc-tools | |
| state: open | |
| sync-iuc-tools: | |
| needs: check | |
| if: needs.check.outputs.pr_number == '' || github.event.inputs.force == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv pip install --system -r requirements.txt | |
| - name: Clone IUC repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: galaxyproject/tools-iuc | |
| path: tools-iuc | |
| fetch-depth: 0 | |
| - name: Run sync script | |
| run: | | |
| python scripts/sync-iuc-tools.py \ | |
| --tools-yaml tools_iuc.yaml \ | |
| --mapping-file scripts/category-mapping.yml \ | |
| --iuc-repo-path tools-iuc \ | |
| --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --last-sync-sha-file scripts/.last-iuc-sync-sha \ | |
| --skip-list scripts/iuc-sync-skipped-tools.yml \ | |
| --report-file ${{ runner.temp }}/sync-report.md | |
| - name: Check for changes | |
| id: check_changes | |
| uses: tj-actions/verify-changed-files@v20 | |
| - name: Validate changes with pr_check | |
| if: steps.check_changes.outputs.files_changed == 'true' | |
| run: make pr_check | |
| - name: Create or update Pull Request | |
| if: steps.check_changes.outputs.files_changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| branch: sync-iuc-tools | |
| commit-message: 'Add new tools from IUC repository' | |
| title: 'Add new tools from IUC repository' | |
| body-path: ${{ runner.temp }}/sync-report.md | |
| delete-branch: true | |
| add-paths: | | |
| tools_iuc.yaml | |
| scripts/.last-iuc-sync-sha |