Using github action contexts instead of gh CLI

Co-authored-by: Nicola Soranzo <nicola.soranzo@earlham.ac.uk>
This commit is contained in:
Arash
2024-10-14 10:51:13 +02:00
co-authored by Nicola Soranzo
parent f4ffa9d74b
commit 9433ecef18
+2 -2
View File
@@ -18,8 +18,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
TARGET_BRANCH=$(gh pr view $PR_NUMBER --json baseRefName -q .baseRefName)
PR_TITLE=$(gh pr view $PR_NUMBER --json title -q .title)
TARGET_BRANCH="${{ github.base_ref }}"
PR_TITLE="${{ github.event.pull_request.title }}"
VERSION=$(echo $TARGET_BRANCH | grep -oP '\d+\.\d+')
if [[ -n "$VERSION" && ! "$PR_TITLE" =~ ^\[$VERSION\] ]]; then
NEW_TITLE="[$VERSION] $PR_TITLE"