forked from nervosnetwork/ckb-explorer-frontend
-
Notifications
You must be signed in to change notification settings - Fork 6
39 lines (36 loc) · 1.13 KB
/
sync-external-updates.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
name: Sync updates from external repos
on:
schedule:
- cron: '0 */1 * * *'
jobs:
default:
name: Open PR from forked/develop to origin/develop
runs-on: ubuntu-latest
permissions:
pull-requests: write # for opening PR
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Open PR from forked repo to origin one
if: vars.EXTERNAL_REPO != ''
uses: actions/script@v6
with:
script: |
github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
base: 'develop',
head_repo: process.env.REPO,
head: `develop`,
title: `Merge ${process.env.REPO}:develop to develop`,
body: `Ready to deploy`,
}).catch(async res => {
const content = await res.json()
if (content.message.includes('No commits between')) {
return
}
throw new Error(content.message)
})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ vars.EXTERNAL_REPO }}