Skip to content

Commit

Permalink
workflows: commit and push requirements changes in one commit (bug 18…
Browse files Browse the repository at this point in the history
…91529) (#1676)
  • Loading branch information
zzzeid committed Apr 16, 2024
1 parent 3180056 commit e09d1f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/compile-requirements.yml
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
9 changes: 9 additions & 0 deletions .github/workflows/run-compile-requirements.yml
Expand Up @@ -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

0 comments on commit e09d1f9

Please sign in to comment.