|
| 1 | +name: Dispatch Update |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # 7:07 fridays |
| 6 | + - cron: '7 7 * * 5' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + instance: [galaxy-qa1.galaxy.cloud.e-infra.cz, usegalaxy.cz, galaxy-umsa.grid.cesnet.cz] |
| 18 | + python-version: [3.11] |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + - name: Set up Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 31 | + - name: Lint, Fix, and Update |
| 32 | + run: | |
| 33 | + make INSTANCE=$INSTANCE lint |
| 34 | + make INSTANCE=$INSTANCE update-all |
| 35 | + env: |
| 36 | + INSTANCE: ${{ inputs.instance }} |
| 37 | + - name: Set output variables |
| 38 | + id: vars |
| 39 | + run: | |
| 40 | + pr_title="Update all tools of $INSTANCE" |
| 41 | + { |
| 42 | + echo "pr_title=$pr_title" |
| 43 | + echo "branch_name=$INSTANCE" |
| 44 | + echo "pr_body<<EOF" |
| 45 | + echo "I ran the following:" |
| 46 | + echo "- make INSTANCE=$INSTANCE lint" |
| 47 | + echo "- make INSTANCE=$INSTANCE update-all" |
| 48 | + echo "EOF" |
| 49 | + } >> "$GITHUB_OUTPUT" |
| 50 | + env: |
| 51 | + INSTANCE: ${{ inputs.instance }} |
| 52 | + - name: Create Pull Request |
| 53 | + uses: peter-evans/create-pull-request@v7 |
| 54 | + with: |
| 55 | + branch: create-pull-request/${{ steps.vars.outputs.branch_name }} |
| 56 | + # branch-suffix: random |
| 57 | + committer: CESNETbot <martin.cech@cesnet.cz> |
| 58 | + commit-message: ${{ steps.vars.outputs.pr_title }} |
| 59 | + title: ${{ steps.vars.outputs.pr_title }} |
| 60 | + body: ${{ steps.vars.outputs.pr_body }} |
| 61 | + labels: automated |
| 62 | + assignees: martenson |
| 63 | + reviewers: martenson |
| 64 | + # - name: Push changes |
| 65 | + # uses: ad-m/github-push-action@master |
| 66 | + # with: |
| 67 | + # github_token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + # branch: ${{ github.ref }} |
0 commit comments