Skip to content

Commit 427cb2b

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 427cb2b

2 files changed

Lines changed: 726 additions & 0 deletions

File tree

.github/workflows/rebase.yml

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

0 commit comments

Comments
 (0)