From cfdaf90e9400ae54df753cb8c7dec5268585ffd1 Mon Sep 17 00:00:00 2001 From: Konstantina Skovola Date: Mon, 25 Sep 2023 11:33:08 +0300 Subject: [PATCH] Use gh instead --- .github/workflows/catalog-updates-check.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/catalog-updates-check.yaml b/.github/workflows/catalog-updates-check.yaml index 9c12f628bae..7be58682149 100644 --- a/.github/workflows/catalog-updates-check.yaml +++ b/.github/workflows/catalog-updates-check.yaml @@ -20,11 +20,13 @@ jobs: - name: Check if latest-dev was modified shell: bash {0} id: check_updated + env: + GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }} + PR_NUMBER: ${{ github.event.number }} run: | file="sql/updates/latest-dev.sql" updated=0 - # diff=$(git diff --name-status origin/main | grep "${file}") - diff=$(git --no-pager diff --name-only HEAD $(git merge-base HEAD ${{ github.event.pull_request.base.sha }}) | grep "${file}") + diff=$(gh pr view $PR_NUMBER --json files --jq '.files[] | select(.path == "sql/updates/latest-dev.sql") | .path') if [[ ${diff} != "" ]]; then updated=1 fi