Skip to content

Commit

Permalink
github-actions: Generalize package name extraction from dependabot br…
Browse files Browse the repository at this point in the history
…anch name (#2566)

Signed-off-by: Jan Vesely <[email protected]>
  • Loading branch information
jvesely authored Jan 6, 2023
1 parent 7c97f94 commit 930f1d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/actions/install-pnl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ runs:
shell: bash
id: new_package
run: |
export NEW_PACKAGE=$(echo '${{ github.head_ref }}' | cut -f 4 -d/ | sed 's/-gt.*//' | sed 's/-lt.*//')
# The branch name pattern is: "dependabot/pip/$TARGET/$PACKAGE{-gt-$MINVERSION,,}{-lt-$MAXVERSION,}{-$VERSION,}
# The expression below extracts just the $PACKAGE part
export NEW_PACKAGE=$(echo '${{ github.head_ref }}' | cut -f 4 -d/ | sed 's/-gt.*//' | sed 's/-lt.*//' | sed 's/-[0-9\.]*$//' )
if grep "$NEW_PACKAGE" *requirements.txt; then
echo "new_package=$NEW_PACKAGE" >> $GITHUB_OUTPUT
# save a list of all installed packages (including pip, wheel; it's never empty)
Expand Down

0 comments on commit 930f1d7

Please sign in to comment.