Skip to content

Commit

Permalink
Merge pull request #811 from atheo89/followup-on-renewal
Browse files Browse the repository at this point in the history
Make the pipfile renewal to work when cron firing
  • Loading branch information
openshift-merge-bot[bot] authored Dec 17, 2024
2 parents 4332bc2 + 5e9802c commit a0e4503
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/piplock-renewal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
name: Pipfile.locks Renewal Action

on: # yamllint disable-line rule:truthy
# Triggers the workflow every Monday at 22pm UTC am 0 22 * * 1
# Triggers the workflow every Wednesday at 1am UTC
schedule:
- cron: "0 22 * * 1"
- cron: "0 1 * * 3"
workflow_dispatch: # for manual trigger workflow from GH Web UI
inputs:
branch:
Expand Down Expand Up @@ -35,12 +35,16 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
env:
BRANCH: ${{ github.event.inputs.branch || 'main' }}
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11' }}
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
Expand All @@ -53,7 +57,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
Expand All @@ -62,7 +66,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 }}

0 comments on commit a0e4503

Please sign in to comment.