Skip to content

Commit 0520548

Browse files
committed
.github: workflows: rebase.yml: add; scripts: rebase.sh: add
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
1 parent 917c561 commit 0520548

2 files changed

Lines changed: 725 additions & 0 deletions

File tree

.github/workflows/rebase.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Try rebasing on updated upstream, report in case of conflicts
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
first-remote-token:
7+
description: >
8+
Personal access token for performing the following operations on the
9+
downstream-repo: fetch the repository, create a branch, delete a
10+
branch, create commits on a branch, push to a branch, open a PR, close
11+
a PR, get list of PRs.
12+
required: true
13+
type: string
14+
inputs:
15+
downstream-repo:
16+
description: >
17+
<first_repo> parameter for the rebase.sh script.
18+
required: true
19+
type: string
20+
downstream-branch:
21+
description: >
22+
<first_repo_branch> parameter for the rebase.sh script.
23+
required: true
24+
type: string
25+
upstream-repo:
26+
description: >
27+
<second_repo> parameter for the rebase.sh script.
28+
required: true
29+
type: string
30+
upstream-branch:
31+
description: >
32+
<second_repo_branch> parameter for the rebase.sh script.
33+
required: true
34+
type: string
35+
36+
jobs:
37+
build-and-package:
38+
runs-on: ubuntu-latest
39+
name: Try rebasing on updated upstream, report in case of conflicts
40+
permissions:
41+
# For creation/deletion/pushing to branches and creating PRs
42+
contents: write
43+
steps:
44+
- uses: actions/checkout@v6
45+
with:
46+
repository: TrenchBoot/.github
47+
path: shared
48+
ref: ${{ github.job_workflow_sha }}
49+
- name: Run script for rebasing
50+
env:
51+
FIRST_REMOTE_TOKEN: ${{ secrets.first-remote-token }}
52+
DOWNSTREAM_REPO: ${{ inputs.downstream-repo }}
53+
DOWNSTREAM_BRANCH: ${{ inputs.downstream-branch }}
54+
UPSTREAM_REPO: ${{ inputs.upstream-repo }}
55+
UPSTREAM_BRANCH: ${{ inputs.upstream-branch }}
56+
run: |
57+
shared/scripts/rebase.sh --first-remote-token "$FIRST_REMOTE_TOKEN" \
58+
"$DOWNSTREAM_REPO" \
59+
"$DOWNSTREAM_BRANCH" \
60+
"$UPSTREAM_REPO" \
61+
"$UPSTREAM_BRANCH"

0 commit comments

Comments
 (0)