-
Notifications
You must be signed in to change notification settings - Fork 16
56 lines (49 loc) · 1.7 KB
/
nitro-alpha.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: create pr in nitro
on:
pull_request:
types: [labeled]
jobs:
triggeronlabel:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'nitro')
steps:
- name: checkout code
uses: actions/checkout@v2
- name: setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "your name"
- name: generate branch name
id: branch_name
run: |
echo "original branch: ${github_ref#refs/heads/}"
new_branch="${github_ref#refs/heads/}_alpha"
echo "::set-output name=branch::${new_branch}"
- name: create new branch in nitro
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const repo = 'chrome-connect';
const owner = 'markdoeswork';
const branchName = 'merge_alpha'; // Simple branch name
const mainSha = await github.rest.repos.getBranch({
owner,
repo,
branch: 'master',
}).then(data => data.data.commit.sha);
await github.rest.git.createRef({
owner,
repo,
ref: `refs/heads/${branchName}`,
sha: mainSha
});
- name: create pull request in nitro
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.branch_name.outputs.branch }}
destination_branch: "master"
github-token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "automated pr from repo a"
pr_body: "this is an automated pull request."
destination_repo: "markdoeswork/chrome-connect"