Skip to content

Commit

Permalink
feat: upgrade github action to support pinned dependencies (#32619)
Browse files Browse the repository at this point in the history
* fix: edx-enterprise downgrade

* fix: update script

* feat: upgrade action to support pinned dependecies

* Update .github/workflows/upgrade-one-python-dependency.yml

---------
  • Loading branch information
kiram15 committed Jul 6, 2023
1 parent f4540c3 commit b9105a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/upgrade-one-python-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: 'Name of package to upgrade'
required: true
type: string
version:
description: 'Version number to upgrade to in constraints.txt (only needed if pinned)'
default: ''
type: string
change_desc:
description: |
Description of change, for commit message and PR. (What does the new version add or fix?)
Expand All @@ -37,6 +41,13 @@ jobs:
with:
python-version: "3.8"

- name: Update any pinned dependencies
env:
NEW_VERSION: "${{ inputs.version }}"
PACKAGE: "${{ inputs.package }}"
run: |
sed 's/^\('$PACKAGE'[^#]*\)==[^ #]\+/\1=='$NEW_VERSION'/' -i requirements/constraints.txt
- name: Run make upgrade-package
env:
PACKAGE: "${{ inputs.package }}"
Expand Down Expand Up @@ -84,6 +95,7 @@ jobs:
body: |
${{ env.body_prefix }}PR generated by workflow `${{ github.workflow_ref }}` on behalf of @${{ github.triggering_actor }}.
assignees: "${{ github.triggering_actor }}"
reviewers: "${{ github.triggering_actor }}"

- name: Job summary
env:
Expand Down

0 comments on commit b9105a4

Please sign in to comment.