Sync Platform Branch #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | |
}); |