Skip to content

Commit ecdd3ea

Browse files
authored
Merge pull request #56 from ruivieira/sync-branches
feat: Add automated branch sync
2 parents 86004a8 + 1950b2a commit ecdd3ea

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sync branch incubation
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
sync-branches:
9+
if: ${{ github.repository == 'opendatahub-io/guardrails-detectors' }}
10+
runs-on: ubuntu-latest
11+
name: Syncing branch incubation
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
- name: Opening pull request
16+
id: pull
17+
uses: tretuna/sync-branches@1.4.0
18+
with:
19+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
20+
FROM_BRANCH: "main"
21+
TO_BRANCH: "incubation"
22+
- name: Add labels
23+
if: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER != '' }}
24+
uses: actions/github-script@v7
25+
with:
26+
script: |
27+
github.rest.issues.addLabels({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
issue_number: ${{steps.pull.outputs.PULL_REQUEST_NUMBER}},
31+
labels: ['bot/sync-incubation', 'tide/merge-method-merge']
32+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sync branch stable
2+
on:
3+
push:
4+
branches:
5+
- incubation
6+
7+
jobs:
8+
sync-branches:
9+
if: ${{ github.repository == 'opendatahub-io/guardrails-detectors' }}
10+
runs-on: ubuntu-latest
11+
name: Syncing branch stable
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
- name: Opening pull request
16+
id: pull
17+
uses: tretuna/sync-branches@1.4.0
18+
with:
19+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
20+
FROM_BRANCH: "incubation"
21+
TO_BRANCH: "stable"
22+
- name: Add labels
23+
if: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER != '' }}
24+
uses: actions/github-script@v7
25+
with:
26+
script: |
27+
github.rest.issues.addLabels({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
issue_number: ${{steps.pull.outputs.PULL_REQUEST_NUMBER}},
31+
labels: ['bot/sync-stable', 'tide/merge-method-merge']
32+
});

0 commit comments

Comments
 (0)