From b9105a45d9e87370ae515a2faceb4e4903849c98 Mon Sep 17 00:00:00 2001 From: Kira Miller <31229189+kiram15@users.noreply.github.com> Date: Thu, 6 Jul 2023 12:36:19 -0600 Subject: [PATCH] feat: upgrade github action to support pinned dependencies (#32619) * fix: edx-enterprise downgrade * fix: update script * feat: upgrade action to support pinned dependecies * Update .github/workflows/upgrade-one-python-dependency.yml --------- --- .github/workflows/upgrade-one-python-dependency.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/upgrade-one-python-dependency.yml b/.github/workflows/upgrade-one-python-dependency.yml index 1802fa75ac1..2ac704e9993 100644 --- a/.github/workflows/upgrade-one-python-dependency.yml +++ b/.github/workflows/upgrade-one-python-dependency.yml @@ -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?) @@ -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 }}" @@ -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: