diff --git a/.github/workflows/requirements-cron.yml b/.github/workflows/requirements-cron.yml index cb2cd9410..367d8dae7 100644 --- a/.github/workflows/requirements-cron.yml +++ b/.github/workflows/requirements-cron.yml @@ -2,12 +2,28 @@ name: Requirements (scheduled) on: schedule: - - cron: "0 2 */14 * *" + - cron: "0 2 * * 1" workflow_dispatch: jobs: + is-even-week: + name: Check week number is even + runs-on: ubuntu-20.04 + steps: + - name: Determine if week number is even + run: | + WEEK_NUMBER=$(date +%U) + IS_EVEN_WEEK="$(($WEEK_NUMBER % 2 == 0))" + echo "This is week $WEEK_NUMBER. It even week: $IS_EVEN_WEEK" + echo ::set-output name=is-even-week::"$IS_EVEN_WEEK" + id: is-even-week + outputs: + is-even-week: ${{ steps.is-even-week.outputs.is-even-week }} + pip-constraints: name: Update pip constraints files + needs: is-even-week + if: needs.is-even-week.outputs.is-even-week != 0 runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -26,6 +42,8 @@ jobs: pre-commit: name: pre-commit autoupdate + needs: is-even-week + if: needs.is-even-week.outputs.is-even-week != 0 runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2