diff --git a/.github/workflows/major-version-check.yml b/.github/workflows/major-version-check.yml index add734ec730..a7e81280102 100644 --- a/.github/workflows/major-version-check.yml +++ b/.github/workflows/major-version-check.yml @@ -16,6 +16,8 @@ jobs: if: | !contains(github.event.pull_request.labels.*.name, '🤖Skip Major Check') runs-on: ubuntu-latest + env: + HEAD_REF: ${{ github.head_ref }} steps: - name: Checkout code uses: actions/checkout@v3 @@ -24,11 +26,11 @@ jobs: run: git fetch --all - name: Checkout the feature branch - run: git checkout ${{ github.head_ref }} -- + run: git checkout "$HEAD_REF" -- - name: Check major versions in changeset entries run: | - commits="origin/${{ github.base_ref }}...origin/${{ github.head_ref }}" + commits="origin/$("$HEAD_REF")...origin/$("$HEAD_REF")" changeset_files=$(git diff --name-only --diff-filter=d "$commits" -- ".changeset/*.md") if [[ -z "$changeset_files" ]]; then