Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wknapik generic testing 03 #21104

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/rerun-compare-chromium-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Rerun Compare Chromium versions

on:
pull_request:
branches:
- master
- '[0-9]+.[0-9]+.x'
paths:
- package.json
types:
- closed

jobs:
rerun-compare-chromium-versions:
# TODO: uncomment
#if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
TARGET_SHA: ${{ github.event.pull_request.base.sha }}
steps:
- run: |
shopt -s inherit_errexit
set -eEo pipefail

chromium_ver() { curl -fsS "https://raw.githubusercontent.com/${GITHUB_REPOSITORY:?}/${1:?}/package.json"|jq -r .config.projects.chrome.tag; }

pr_ver="$(chromium_ver "${PR_SHA:?}")"
target_ver="$(chromium_ver "${TARGET_SHA:?}")"

echo "::notice::PR branch: ${pr_ver:?}, target branch: ${target_ver:?}"

if [[ "${pr_ver%%.*}" != "${target_ver%%.*}" ]]; then
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:?}"
if [[ "$run_id" ]]; then
echo "Rerunning $run_id for $pr_url"
# TODO: remove echo and add sleep
echo gh -R "$GITHUB_REPOSITORY" run rerun "$run_id"
else
echo "No run found for $pr_url"
fi
sleep 1
done < <(gh -R "$GITHUB_REPOSITORY" pr list --limit 1000 --state open --base "$GITHUB_BASE_REF" --json number,headRefOid -q '.[]|"\(.number)\t\(.headRefOid)"')
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"projects": {
"chrome": {
"dir": "src",
"tag": "130.0.6723.58",
"tag": "131.0.6723.58",
"repository": {
"url": "https://github.com/brave/chromium"
}
Expand Down
Loading