-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.31 KB
/
merge-forward 1.yaml
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
name: Release Workflow 2
on:
push:
branches:
- release/*
jobs:
merge_commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "DevOps ${{ github.workflow }}"
- name: Read release branch from file
id: read_branch
run: |
RELEASE_BRANCH=$(cat release_branch.txt)
echo "::set-output name=branch::${RELEASE_BRANCH}"
- name: Merge and push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e -v
gitcommit=$(git rev-parse HEAD)
git checkout ${{ steps.read_branch.outputs.branch }}
git merge $gitcommit --no-ff
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/mbuchoff/automerge.git
git push origin
- name: Trigger Secondary Workflow on Different Branch
uses: benc-uk/workflow-dispatch@v1
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
workflow: merge-forward 2.yml
token: ${{ secrets.GITHUB_TOKEN }}
ref: release/2 # Specify the target branch here