diff --git a/.github/workflows/build_blinky.yml b/.github/workflows/build_blinky.yml index d9b74dcb45..eb46933cdd 100644 --- a/.github/workflows/build_blinky.yml +++ b/.github/workflows/build_blinky.yml @@ -30,7 +30,9 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-go@v3 with: go-version: 'stable' @@ -53,8 +55,9 @@ jobs: cp -f .github/project.yml build/project.yml cd build newt upgrade --shallow=1 - rm -rf repos/apache-mynewt-core - git clone .. repos/apache-mynewt-core + git -C repos/apache-mynewt-core fetch $GITHUB_SHA + sed -i "s/0.0.0/$GITHUB_SHA-commit/g" project.yml + newt upgrade --shallow=1 cd .. - name: Build Blinky shell: bash diff --git a/.github/workflows/build_bootloader.yml b/.github/workflows/build_bootloader.yml index 0cd89f9aa9..8a4b20a2e5 100644 --- a/.github/workflows/build_bootloader.yml +++ b/.github/workflows/build_bootloader.yml @@ -53,8 +53,10 @@ jobs: cp -f .github/project.yml build/project.yml cd build newt upgrade --shallow=1 - rm -rf repos/apache-mynewt-core - git clone .. repos/apache-mynewt-core + SHA=`git rev-parse HEAD` + git -C repos/apache-mynewt-core fetch $SHA + sed -i "s/0.0.0/$SHA-commit/g" project.yml + newt upgrade --shallow=1 cd .. - name: Build bootloader shell: bash diff --git a/.github/workflows/build_cc_target.yml b/.github/workflows/build_cc_target.yml index daf8e8c63e..43dc5b3c27 100644 --- a/.github/workflows/build_cc_target.yml +++ b/.github/workflows/build_cc_target.yml @@ -50,8 +50,10 @@ jobs: cp -f .github/project.yml build/project.yml cd build newt upgrade --shallow=1 - rm -rf repos/apache-mynewt-core - git clone .. repos/apache-mynewt-core + SHA=`git rev-parse HEAD` + git -C repos/apache-mynewt-core fetch $SHA + sed -i "s/0.0.0/$SHA-commit/g" project.yml + newt upgrade --shallow=1 cd .. - name: Build targets shell: bash diff --git a/.github/workflows/build_targets.yml b/.github/workflows/build_targets.yml index d3b113d8ab..9bb528cbdf 100644 --- a/.github/workflows/build_targets.yml +++ b/.github/workflows/build_targets.yml @@ -48,9 +48,11 @@ jobs: cp -f .github/project.yml build/project.yml cd build newt upgrade --shallow=1 + SHA=`git rev-parse HEAD` + git -C repos/apache-mynewt-core fetch $SHA + sed -i "s/0.0.0/$SHA-commit/g" project.yml + newt upgrade --shallow=1 rm -rf targets - rm -rf repos/apache-mynewt-core - git clone .. repos/apache-mynewt-core cd .. - name: Build targets shell: bash diff --git a/.github/workflows/newt_test_all.yml b/.github/workflows/newt_test_all.yml index c6480deccf..94bb571d2d 100644 --- a/.github/workflows/newt_test_all.yml +++ b/.github/workflows/newt_test_all.yml @@ -45,8 +45,10 @@ jobs: cp -f .github/project.yml build/project.yml cd build newt upgrade --shallow=1 - rm -rf repos/apache-mynewt-core - git clone .. repos/apache-mynewt-core + SHA=`git rev-parse HEAD` + git -C repos/apache-mynewt-core fetch $SHA + sed -i "s/0.0.0/$SHA-commit/g" project.yml + newt upgrade --shallow=1 cd .. - name: newt test all run: |