Skip to content

Commit a0e4503

Browse files
Merge pull request #811 from atheo89/followup-on-renewal
Make the pipfile renewal to work when cron firing
2 parents 4332bc2 + 5e9802c commit a0e4503

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/piplock-renewal.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
name: Pipfile.locks Renewal Action
44

55
on: # yamllint disable-line rule:truthy
6-
# Triggers the workflow every Monday at 22pm UTC am 0 22 * * 1
6+
# Triggers the workflow every Wednesday at 1am UTC
77
schedule:
8-
- cron: "0 22 * * 1"
8+
- cron: "0 1 * * 3"
99
workflow_dispatch: # for manual trigger workflow from GH Web UI
1010
inputs:
1111
branch:
@@ -35,12 +35,16 @@ jobs:
3535
runs-on: ubuntu-latest
3636
permissions:
3737
contents: write
38+
env:
39+
BRANCH: ${{ github.event.inputs.branch || 'main' }}
40+
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11' }}
41+
INCLUDE_OPT_DIRS: ${{ github.event.inputs.update_optional_dirs || 'false' }}
3842
steps:
3943
# Checkout the specified branch from the specified organization
4044
- name: Checkout code from the specified branch
4145
uses: actions/checkout@v4
4246
with:
43-
ref: ${{ github.event.inputs.branch }}
47+
ref: ${{ env.BRANCH }}
4448
token: ${{ secrets.GH_ACCESS_TOKEN }}
4549

4650
# Configure Git
@@ -53,7 +57,7 @@ jobs:
5357
- name: Setup Python environment
5458
uses: actions/setup-python@v5
5559
with:
56-
python-version: ${{ github.event.inputs.python_version }}
60+
python-version: ${{ env.PYTHON_VERSION }}
5761

5862
# Install pipenv
5963
- name: Install pipenv
@@ -62,7 +66,7 @@ jobs:
6266
# Run makefile recipe to refresh Pipfile.lock and push changes back to the branch
6367
- name: Run make refresh-pipfilelock-files and push the changes back to the branch
6468
run: |
65-
make refresh-pipfilelock-files PYTHON_VERSION=${{ github.event.inputs.python_version }} INCLUDE_OPT_DIRS=${{ github.event.inputs.update_optional_dirs }}
69+
make refresh-pipfilelock-files PYTHON_VERSION=${{ env.PYTHON_VERSION }} INCLUDE_OPT_DIRS=${{ env.INCLUDE_OPT_DIRS }}
6670
git add .
6771
git commit -m "Update Pipfile.lock files by piplock-renewal.yaml action"
68-
git push origin ${{ github.event.inputs.branch }}
72+
git push origin ${{ env.BRANCH }}

0 commit comments

Comments
 (0)