From c71fdd5bdc4c97d5d33c18f7ad5c078095b42068 Mon Sep 17 00:00:00 2001 From: Wojciech Knapik <1129003+wknapik@users.noreply.github.com> Date: Thu, 24 Oct 2024 23:44:21 +0200 Subject: [PATCH] Minor improvements in rerun-compare-chromium-versions (#26161) --- .github/workflows/rerun-compare-chromium-versions.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rerun-compare-chromium-versions.yml b/.github/workflows/rerun-compare-chromium-versions.yml index ed014b374d2d..bf4e5463f3be 100644 --- a/.github/workflows/rerun-compare-chromium-versions.yml +++ b/.github/workflows/rerun-compare-chromium-versions.yml @@ -19,7 +19,8 @@ jobs: PR_SHA: ${{ github.event.pull_request.head.sha }} TARGET_SHA: ${{ github.event.pull_request.base.sha }} steps: - - run: | + - name: If a major Chromium bump was merged, rerun compare-chromium-versions in all PRs targeting the same branch + run: | shopt -s inherit_errexit set -eEo pipefail @@ -28,9 +29,10 @@ jobs: pr_ver="$(chromium_ver "${PR_SHA:?}")" target_ver="$(chromium_ver "${TARGET_SHA:?}")" - echo "::notice::PR branch: ${pr_ver:?}, target branch: ${target_ver:?}" + echo "::notice::PR branch: ${GITHUB_HEAD_REF:?} (${pr_ver:?}), target branch: ${GITHUB_BASE_REF:?} (${target_ver:?})" if [[ "${pr_ver%%.*}" != "${target_ver%%.*}" ]]; then + echo "::notice::Rerunning compare-chromium-versions in PRs targeting ${GITHUB_BASE_REF:?}" while read -r pr_number head_sha; do run_id="$(gh api "/repos/$GITHUB_REPOSITORY/actions/workflows/compare-chromium-versions.yml/runs?head_sha=${head_sha:?}" -q '.workflow_runs[0].id')" pr_url="https://github.com/brave/brave-core/pull/${pr_number:?}" @@ -43,5 +45,5 @@ jobs: sleep 1 done < <(gh -R "$GITHUB_REPOSITORY" pr list --limit 1000 --state open --base "$GITHUB_BASE_REF" --json number,headRefOid -q '.[]|"\(.number)\t\(.headRefOid)"') else - echo "Chromium major versions match, nothing to do" + echo "::notice::Chromium major versions match, nothing to do" fi