From 9433ecef185e2e4c745bf26dbce1b592da36b0f2 Mon Sep 17 00:00:00 2001 From: Arash Date: Mon, 14 Oct 2024 10:51:10 +0200 Subject: [PATCH] Using github action contexts instead of gh CLI Co-authored-by: Nicola Soranzo --- .github/workflows/pr-title-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-title-update.yml b/.github/workflows/pr-title-update.yml index a4f6e32ebf4..48279425706 100644 --- a/.github/workflows/pr-title-update.yml +++ b/.github/workflows/pr-title-update.yml @@ -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"