summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoni L <EnderMoneyMod@gmail.com>2022-02-24 01:03:55 -0300
committerGitHub <noreply@github.com>2022-02-23 20:03:55 -0800
commit08cf71aa180674432750a02581f1e214c310042d (patch)
tree8666b660f8f7ef2c4def8e3278c399f80016075f
parent897e3d908673b26dafc0fe70660b171e27209768 (diff)
downloadwabt-08cf71aa180674432750a02581f1e214c310042d.tar.gz
wabt-08cf71aa180674432750a02581f1e214c310042d.tar.bz2
wabt-08cf71aa180674432750a02581f1e214c310042d.zip
Fix lint CI on push (#1839)
-rw-r--r--.github/workflows/build.yml2
-rwxr-xr-xscripts/clang-format-diff.sh2
2 files changed, 4 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1a5a0738..e707d57b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,6 +23,8 @@ jobs:
sudo apt-get install clang-format
- run: flake8
- run: ./scripts/clang-format-diff.sh
+ env:
+ GITHUB_EVENT_BEFORE: ${{ github.event.before }}
build:
name: build
runs-on: ${{ matrix.os }}
diff --git a/scripts/clang-format-diff.sh b/scripts/clang-format-diff.sh
index 01a813f2..3348542c 100755
--- a/scripts/clang-format-diff.sh
+++ b/scripts/clang-format-diff.sh
@@ -5,6 +5,8 @@ set -o pipefail
if [ -n "$1" ]; then
BRANCH="$1"
+elif [ -n "$GITHUB_EVENT_BEFORE" ] && [ "push" = "$GITHUB_EVENT_NAME" ]; then
+ BRANCH="$GITHUB_EVENT_BEFORE"
elif [ -n "$GITHUB_BASE_REF" ]; then
BRANCH="origin/$GITHUB_BASE_REF"
else