diff --git a/.github/workflows/piplock-renewal.yaml b/.github/workflows/piplock-renewal.yaml index f48419a09..772335b59 100644 --- a/.github/workflows/piplock-renewal.yaml +++ b/.github/workflows/piplock-renewal.yaml @@ -3,15 +3,15 @@ name: Pipfile.locks Renewal Action on: # yamllint disable-line rule:truthy - # Triggers the workflow every Monday at 22pm UTC am 0 22 * * 1 - schedule: - - cron: "0 22 * * 1" + # Triggers the workflow every Wednesday at 1am UTC + # schedule: + # - cron: "0 1 * * 3" workflow_dispatch: # for manual trigger workflow from GH Web UI inputs: branch: description: 'Specify branch' required: false - default: 'main' + default: '2024a' python_version: description: 'Select Python version to update Pipfile.lock' required: false @@ -34,12 +34,16 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + env: + BRANCH: ${{ github.event.inputs.branch || '2024a' }} + PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.9' }} + INCLUDE_OPT_DIRS: ${{ github.event.inputs.update_optional_dirs || 'false' }} steps: # Checkout the specified branch from the specified organization - name: Checkout code from the specified branch uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.branch }} + ref: ${{ env.BRANCH }} token: ${{ secrets.GH_ACCESS_TOKEN }} # Configure Git @@ -52,7 +56,7 @@ jobs: - name: Setup Python environment uses: actions/setup-python@v5 with: - python-version: ${{ github.event.inputs.python_version }} + python-version: ${{ env.PYTHON_VERSION }} # Install pipenv - name: Install pipenv @@ -61,7 +65,7 @@ jobs: # Run makefile recipe to refresh Pipfile.lock and push changes back to the branch - name: Run make refresh-pipfilelock-files and push the changes back to the branch run: | - make refresh-pipfilelock-files PYTHON_VERSION=${{ github.event.inputs.python_version }} INCLUDE_OPT_DIRS=${{ github.event.inputs.update_optional_dirs }} + make refresh-pipfilelock-files PYTHON_VERSION=${{ env.PYTHON_VERSION }} INCLUDE_OPT_DIRS=${{ env.INCLUDE_OPT_DIRS }} git add . git commit -m "Update Pipfile.lock files by piplock-renewal.yaml action" - git push origin ${{ github.event.inputs.branch }} + git push origin ${{ env.BRANCH }}