diff --git a/.github/workflows/compile-requirements.yml b/.github/workflows/compile-requirements.yml index 7a17e6f1a..33ba300a9 100644 --- a/.github/workflows/compile-requirements.yml +++ b/.github/workflows/compile-requirements.yml @@ -23,9 +23,13 @@ on: description: A string representation of a list of requirement files. required: false type: string + commit_and_push: + type: string + default: 'false' jobs: compile-requirements: + if: ${{ inputs.commit_and_push != 'true' }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -56,7 +60,7 @@ jobs: name: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}-requirements path: requirements/requirements-${{ matrix.python-version }}-${{ runner.os }}.txt commit-and-push: - needs: compile-requirements + if: ${{ inputs.commit_and_push == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -79,4 +83,4 @@ jobs: find temp-requirements -name "requirements-*" -type f -exec mv -f -t requirements {} + git add -A git commit -m "Automatically generated requirements" - until git push -f https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git; do git pull --rebase; done + git push -f https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git diff --git a/.github/workflows/run-compile-requirements.yml b/.github/workflows/run-compile-requirements.yml index 45532ece5..85964f3fc 100644 --- a/.github/workflows/run-compile-requirements.yml +++ b/.github/workflows/run-compile-requirements.yml @@ -28,3 +28,12 @@ jobs: requirements_files: '["base.in base.universal2.in dev.in gui-dev.in gui.in linters.in"]' os: '["macos-latest"]' python: '["3.9", "3.10", "3.11"]' + + commit-and-push: + uses: ./.github/workflows/compile-requirements.yml + with: + commit_and_push: 'true' + needs: + - call-compile-requirements-macos + - call-compile-requirements-windows + - call-compile-requirements-linux