forked from carbon-design-system/carbon-website
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 2.26 KB
/
sync-platform-branch.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
56
57
58
name: Sync Platform Branch
on:
schedule:
# Runs on Fridays 6:00 UTC (-6 CT, -5 EST)
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
- cron: 0 6 * * 5
# Enable running this workflow manually from the Actions tab
workflow_dispatch: # Allow for running this manually.
jobs:
sync-branches:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create PR branch 🤖
run: |
git branch carbon-platform-sync
git push origin carbon-platform-sync
- name: Create Pull Request
uses: actions/github-script@v6
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'Sync carbon-platform branch',
owner,
repo,
head: 'carbon-platform-sync',
base: 'carbon-platform',
body: [
'Platform Sync, pulling in new content from main into carbon-platform branch',
'This PR is auto-generated by [actions/github-script](https://github.com/actions/github-script).',
"**Note**: It’s ok for the CI cheks to fail on this PR, this code is not runnable due to the platform changes"
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['status: enable automerge 🟠', 'status: ready for review 👀']
});
github.rest.pulls.requestReviewers({
owner,
repo,
pull_number: result.data.number,
reviewers: ['francinelucca', 'andreancardona', 'alisonjoseph']
});