diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index a195681f9..596f2f26f 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -44,8 +44,6 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - with: - submodules: true - name: Bootstrap if: "github.event_name == 'push'" run: | @@ -55,6 +53,7 @@ jobs: env: OT_BASE_BRANCH: "${{ github.base_ref }}" SIZE_REPORT_URL: "https://openthread-size-report.glitch.me/size-report/1354027" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" run: | export PATH=$PATH:$HOME/.local/bin ./script/check-size diff --git a/script/check-size b/script/check-size index 17deb26fe..bf9f2345b 100755 --- a/script/check-size +++ b/script/check-size @@ -157,7 +157,7 @@ size_nrf52840_version() # new commit mkdir -p "${OT_TMP_DIR}/b" - git clone https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/b" + script/git-tool clone https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/b" rm -rf "${OT_TMP_DIR}/b/openthread/*" # replace openthread submodule with latest commit git archive "${OT_SHA_NEW}" | tar x -C "${OT_TMP_DIR}/b/openthread" diff --git a/script/git-tool b/script/git-tool index 4cf8ba175..5acb5c75e 100755 --- a/script/git-tool +++ b/script/git-tool @@ -38,13 +38,12 @@ apply_dependencies() project_name=$(git remote get-url origin | grep -oE '[^/:]+/[^/:]+\.git$' | cut -d. -f1) echo "project name: ${project_name}" - depends_on_pr="$(grep -E "^Depends-On: *${project_name}" | cut -d# -f2)" || { - echo "No dependency on ${project_name} found." - return 0 - } - echo "pr: #${depends_on_pr}" - git fetch --depth 1 origin "pull/${depends_on_pr}/head" - git checkout FETCH_HEAD + while read -r dependency; do + echo "${dependency}" + depends_on_pr="$(echo "${dependency}" | tr -d '\r\n' | cut -d# -f2)" + echo "pr: #${depends_on_pr}" + git pull origin "pull/${depends_on_pr}/merge" + done < <(grep -E "^Depends-On: *${project_name}" || true) } get_pr_body()