Keep workflows enabled #32
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
| # This workflow regularly disables and re-enables scheduled GH Action workflows. | |
| # Reasons: | |
| # 1. Ensures that email notifications for scheduled runs are configurable by the | |
| # team under nextstrain-bot's account settings. | |
| # 2. Prevents workflows from being automatically disabled when no repository | |
| # activity has occurred in 60 days. | |
| name: Keep workflows enabled | |
| on: | |
| schedule: | |
| # Scheduled to run at 4pm UTC (8am PST) on the first day of the month | |
| - cron: '0 16 1 * *' | |
| workflow_dispatch: | |
| jobs: | |
| enable-workflow: | |
| permissions: | |
| actions: write | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_WORKFLOW_DISPATCH }} | |
| name: "${{ matrix.repo }}:${{ matrix.workflow }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { repo: .github, workflow: keep-workflows-enabled.yaml } | |
| - { repo: augur, workflow: ci.yaml } | |
| - { repo: avian-flu, workflow: ingest-to-phylogenetic-ncbi.yaml } | |
| - { repo: chikv, workflow: fetch-and-ingest.yaml } | |
| - { repo: cli, workflow: ci.yaml } | |
| - { repo: cli, workflow: standalone-installers.yaml } | |
| - { repo: conda-base, workflow: installation.yaml } | |
| - { repo: dengue, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: ebola, workflow: ci.yaml } | |
| - { repo: ebola, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: forecasts-ncov, workflow: run-usa-models.yaml } | |
| - { repo: forecasts-ncov, workflow: update-ncov-case-counts.yaml } | |
| - { repo: hmpv, workflow: ingest.yaml } | |
| - { repo: lassa, workflow: ci.yaml } | |
| - { repo: lassa, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: measles, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: mpox, workflow: fetch-and-ingest.yaml } | |
| - { repo: mumps, workflow: ingest.yaml } | |
| - { repo: ncov, workflow: rebuild-100k.yml } | |
| - { repo: ncov-ingest, workflow: fetch-and-ingest-genbank-master.yml } | |
| - { repo: nextclade_data, workflow: update-sars-cov-2-datasets.yml } | |
| - { repo: nextstrain.org, workflow: index-resources.yml } | |
| - { repo: nextstrain.org, workflow: remind-to-promote.yml } | |
| - { repo: nipah, workflow: ci.yaml } | |
| - { repo: nipah, workflow: ingest.yaml } | |
| - { repo: norovirus, workflow: ingest.yaml } | |
| - { repo: oropouche, workflow: ingest.yaml } | |
| - { repo: rabies, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: rsv, workflow: fetch-and-ingest.yaml } | |
| - { repo: rsv, workflow: rebuild.yaml } | |
| - { repo: rubella, workflow: ingest.yaml } | |
| - { repo: seasonal-cov, workflow: ingest.yaml } | |
| - { repo: seasonal-flu, workflow: run-private-nextflu-builds.yaml } | |
| - { repo: status, workflow: ci.yaml } | |
| - { repo: tb, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: WNV, workflow: ci.yaml } | |
| - { repo: WNV, workflow: ingest-to-phylogenetic.yaml } | |
| - { repo: yellow-fever, workflow: ingest.yaml } | |
| - { repo: zika, workflow: ingest.yaml } | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Disable workflow | |
| run: | | |
| gh api \ | |
| --method PUT \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| /repos/nextstrain/${{matrix.repo}}/actions/workflows/${{matrix.workflow}}/disable | |
| - name: Sleep | |
| run: sleep 5 | |
| - name: Enable workflow | |
| run: | | |
| gh api \ | |
| --method PUT \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| /repos/nextstrain/${{matrix.repo}}/actions/workflows/${{matrix.workflow}}/enable |