forked from trycompai/comp
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.78 KB
/
auto-pr-to-release.yml
File metadata and controls
41 lines (41 loc) · 1.78 KB
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
name: Create Main -> Release Pull Request
on:
push:
branches:
- main
jobs:
create-pull-request:
runs-on: warp-ubuntu-latest-arm64-4x
permissions:
pull-requests: write
contents: write
issues: write
steps:
- name: Add permissions
run: git config --global --add safe.directory /github/workspace
continue-on-error: true
- name: Check out repository code
uses: actions/checkout@v3
continue-on-error: true
- name: Get package version
id: package-version
run: echo "::set-output name=PACKAGE_VERSION::$(cat package.json | jq -r .version)"
# The pull-request action will now only run if the checkout action was successful.
- name: Create pull request
if: ${{ success() }} # This step runs only if all previous steps succeeded
uses: repo-sync/pull-request@v2
continue-on-error: true
with:
destination_branch: 'release'
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_label: 'prod-deploy,automated-pr'
pr_title: '[${{ github.event.repository.name }}] Production Deploy'
pr_body: |
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
# Optionally, you can add a step here to notify you if the previous steps failed,
# so that you can take appropriate actions.
- name: Notify Failure
if: ${{ failure() }} # This step runs only if any of the previous steps failed
run: echo "A step in the job failed. Please check the GitHub Actions logs for details."
# You could also trigger other types of notifications, such as sending an email, an alert to Slack, etc.