diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..0da603a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,22 @@ +name: Check +on: + pull_request: + paths: + - assets/** + +jobs: + check_database_update: + name: Check libphonenumber database update + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Update assets + run: ./assets/update.sh + - name: Check git status + run: | + if [[ -n "$(git status --porcelain=v2)" ]]; + then + echo "Found untracked or uncommitted files after updating the libphonenumber database, failing." + exit 1 + fi \ No newline at end of file diff --git a/assets/update.sh b/assets/update.sh index a7bee27..2e1c523 100755 --- a/assets/update.sh +++ b/assets/update.sh @@ -1,5 +1,6 @@ #!/bin/bash set -eu +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd GIT_REF=v8.13.35 TMP_CLONE_DIR=$(mktemp -d)