-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (61 loc) · 2.19 KB
/
merge.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
59
60
61
name: Merge
on:
repository_dispatch:
types: [ merge ]
jobs:
build:
strategy:
matrix:
os: [ macos-latest ]
node-version: [ 16.x ]
runs-on: ${{ matrix.os }}
steps:
- run: echo ${{ github.event.client_payload.ref }}
- uses: actions-ecosystem/action-regex-match@v2
id: branch-match
with:
text: ${{ github.event.client_payload.ref }}
regex: '^refs\/tags\/(v\d+\.\d+).*$'
- name: Get Version
shell: bash -l {0}
run: |
version=${{steps.branch-match.outputs.group1}}
echo "VERSION=$version" >> $GITHUB_ENV
- run: echo ${{ env.VERSION }}
- name: Creating Private Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Config Github Username
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Adding Upstream
run: |
git remote add upstream [email protected]:labsyspharm/minerva_analysis.git
- name: Fetching from Upstream
run: |
git fetch upstream
- name: Merging in Upstream
run: |
git merge upstream/gating --allow-unrelated-histories --strategy-option ours
- name: Config Github files
continue-on-error: true
run: |
git commit -m "Automated Release ${{ env.VERSION }}" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GATING_PAT }}
branch: ${{ github.ref }}
- name: Create Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GATING_PAT }}
repository: labsyspharm/gating
event-type: release
client-payload: '{"version": "${{env.VERSION}}"}'