Skip to content

Commit 1467b0f

Browse files
committed
WIP linearize main
Change-Id: If08149432301800c5b057db655258477bb27b9ed
1 parent 6e5ff39 commit 1467b0f

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: linearize_main
2+
3+
on:
4+
schedule:
5+
# GMT timezone.
6+
- cron: '0 10 * * *'
7+
workflow_dispatch:
8+
9+
permissions: read-all
10+
11+
jobs:
12+
trigger_linearize:
13+
# runs-on: ubuntu-latest
14+
runs-on: [self-hosted, chrobalt-linux-runner]
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout main
19+
uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
fetch-depth: 6
23+
- name: Checkout rebase_tools
24+
uses: actions/checkout@v4
25+
with:
26+
ref: experimental/rebase_tools
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.9'
30+
cache: 'pip'
31+
- name: Install rebase_tools
32+
run: |
33+
set -eux
34+
pip install -r requirements.txt
35+
- name: Setup Git
36+
run: |
37+
git config --global user.name "GitHub Release Automation"
38+
git config --global user.email "github@google.com"
39+
- name: Run linearize
40+
run: |
41+
set -eux
42+
# m114 merge commit=38a06fe8674ad2140ff85c87b5b3a817304e369a
43+
# test merge commit=1c94965e70428e8415ea1b0813ad93a4e6067e81
44+
export REV=$(git rev-parse --verify origin/main)
45+
# This will
46+
python main.py linearize --repo-path=${GITHUB_WORKSPACE} --source-branch=main --new-branch-name=feature/linear_main \
47+
--start-commit-ref=1c94965e70428e8415ea1b0813ad93a4e6067e81 --end-commit-ref=${REV} --commit-output="${GITHUB_WORKSPACE}/linear_main_commit_mapping.json"
48+
# Stash the commit mapping
49+
git add linear_main_commit_mapping.json
50+
git stash
51+
- name: Update feature/linear_main
52+
run: |
53+
set -eux
54+
git push --force origin feature/linear_main:feature/linear_main
55+
- name: Checkout rebase_tools
56+
uses: actions/checkout@v4
57+
with:
58+
ref: experimental/rebase_tools
59+
- name: Update commit mapping
60+
run: |
61+
set -eux
62+
# Force apply stashed changes
63+
git checkout stash -- .
64+
git add linear_main_commit_mapping.json
65+
git commit -m "Linearization refresh on $(date +'%Y-%m-%d')."
66+
git push --force origin experimental/rebase_tools

0 commit comments

Comments
 (0)