mirror of https://github.com/ARMmbed/mbed-os.git
github action: add git safe directory
Where we use git commands directly, we need to add safe directory. This is because the recent git changes introduced, for details visit: https://github.com/actions/checkout/issues/766pull/15270/head
parent
8a59067c1b
commit
ad15f0a7dc
|
@ -21,6 +21,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: install dependencies
|
name: install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -32,7 +33,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
mkdir -p SCANCODE
|
mkdir -p SCANCODE
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
||||||
| ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true )
|
| ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true )
|
||||||
echo $?
|
echo $?
|
||||||
|
@ -67,6 +68,7 @@ jobs:
|
||||||
-
|
-
|
||||||
name: include check
|
name: include check
|
||||||
run: |
|
run: |
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
# checks mbed.h is not included in MbedOS files except in tests
|
# checks mbed.h is not included in MbedOS files except in tests
|
||||||
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
|
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
|
||||||
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
|
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
|
||||||
|
@ -88,6 +90,7 @@ jobs:
|
||||||
-
|
-
|
||||||
name: UTF-8 Check
|
name: UTF-8 Check
|
||||||
run: |
|
run: |
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
# Make sure we're not introducing any text which is not UTF-8 encoded
|
# Make sure we're not introducing any text which is not UTF-8 encoded
|
||||||
git diff origin/${GITHUB_BASE_REF} -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' )
|
git diff origin/${GITHUB_BASE_REF} -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' )
|
||||||
|
|
||||||
|
@ -96,6 +99,7 @@ jobs:
|
||||||
name: astyle checks
|
name: astyle checks
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
||||||
| ( grep '.*\.\(c\|cpp\|h\|hpp\)$' || true ) \
|
| ( grep '.*\.\(c\|cpp\|h\|hpp\)$' || true ) \
|
||||||
| ( grep -v -f .codecheckignore || true ) \
|
| ( grep -v -f .codecheckignore || true ) \
|
||||||
|
@ -192,6 +196,7 @@ jobs:
|
||||||
name: validate pins
|
name: validate pins
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF} \
|
||||||
| ( grep '.*[\\|\/]PinNames.h$' || true ) \
|
| ( grep '.*[\\|\/]PinNames.h$' || true ) \
|
||||||
| while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done
|
| while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done
|
||||||
|
@ -245,6 +250,7 @@ jobs:
|
||||||
name: frozen tool check
|
name: frozen tool check
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||||
git diff --name-only origin/${GITHUB_BASE_REF} \
|
git diff --name-only origin/${GITHUB_BASE_REF} \
|
||||||
| egrep \
|
| egrep \
|
||||||
-e "^tools/build_api*" \
|
-e "^tools/build_api*" \
|
||||||
|
|
|
@ -7,11 +7,6 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Work around https://github.com/actions/checkout/issues/766
|
|
||||||
run: |
|
|
||||||
cd "${GITHUB_WORKSPACE}" || exit 1
|
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue