Skip to content

Commit

Permalink
fix show-ref calls
Browse files Browse the repository at this point in the history
  • Loading branch information
calebofearth committed Apr 24, 2024
1 parent 0c76f4c commit 70360bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pre-run-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ jobs:
SOURCE_BR: ${{ github.event.pull_request.head.ref }}
SOURCE_FORK: ${{ github.event.pull_request.head.repo.fork }}
SOURCE_OWN: ${{ github.event.pull_request.head.repo.owner.login }}
SOURCE_NAME: ${{ github.event.pull_request.head.repo.name }}
SOURCE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
TARGET_BR: ${{ github.event.pull_request.base_ref }}
run: |
echo "Comparing $SOURCE_NAME/$SOURCE_BR against merge target $TARGET_BR to look for compile.yml"
echo "Comparing $SOURCE_OWN/$SOURCE_BR against merge target origin/$TARGET_BR to look for compile.yml"
local_msft_actors=${{ env.MSFT_ACTORS }}
for msft_actor in "${local_msft_actors[@]}"; do
if [[ "${PR_OPENER}" == "${msft_actor}" ]]; then
Expand All @@ -57,15 +56,15 @@ jobs:
echo "adding remote '${SOURCE_OWN}' at url '${SOURCE_URL}'"
git remote add -f ${SOURCE_OWN} ${SOURCE_URL}
fi
echo "target is $(git show-ref ${TARGET_BR} 2> /dev/null)"
echo "target is $(git show-ref origin/${TARGET_BR} 2> /dev/null)"
echo "source is $(git show-ref ${SOURCE_OWN}/${SOURCE_BR} 2> /dev/null)"
echo "log source is"
git log --oneline -n 15 ${SOURCE_OWN}/${SOURCE_BR}
echo "=== branches ==="
git branch -a
echo "=== remotes ==="
git remote
compiles=$(git diff --name-only $(git show-ref --hash "origin/$TARGET_BR")...$(git show-ref --abbrev "${SOURCE_OWN}/${SOURCE_BR}"))
compiles=$(git diff --name-only $(git show-ref --hash "origin/$TARGET_BR")...$(git show-ref --hash "${SOURCE_OWN}/${SOURCE_BR}"))
if [[ $(grep -c compile.yml <<< "$compiles") -gt 0 ]]; then
echo "compile.yml should not be modified for pull requests! Found:"
echo "$compiles"
Expand Down

0 comments on commit 70360bb

Please sign in to comment.