-
Notifications
You must be signed in to change notification settings - Fork 20
46 lines (43 loc) · 1.62 KB
/
open-PR.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
# Auto open PR
name: auto-open-pr
on:
repository_dispatch:
types: trigger-frontend
workflow_dispatch:
jobs:
auto-open-pr:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: create the branch
uses: peterjgrainger/[email protected]
with:
branch: 'develop-update-schematic'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get commit sha, release tag, and branch name
run: |
echo 'COMMIT_REF=${{ github.event.client_payload.commit-sha }}' >> $GITHUB_ENV
echo 'RELEASE_VERSION=${{ github.event.client_payload.release-version }}' >> $GITHUB_ENV
echo 'DEFAULT_VAL='empty'' >> $GITHUB_ENV
#### create different pull request based on if release tag exists.
## when a new release is available
- name: Update values.yaml
uses: fjogeleit/yaml-update-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
valueFile: schematic_config.yml
branch: develop-update-schematic
targetBranch: develop
createPR: true
labels: 'auto-PR'
title: 'Version Updates triggered by schematic'
description: Triggered by schematic updates
message: 'Triggered by schematic updates'
changes: |
{
"schematic.branch": "${{ env.BRANCH_NAME|| env.DEFAULT_VAL }}",
"schematic.sha": "${{ env.COMMMIT_REF || env.DEFAULT_VAL }}",
"schematic.release_version": "${{ env.RELEASE_VERSION || env.DEFAULT_VAL}}"
}