forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (56 loc) · 2.15 KB
/
repatriate-lts.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
name: repatriate-to-lts
on:
push:
branches:
- master
jobs:
repatriate-to-lts:
runs-on: ubuntu-latest
name: repatriate-to-lts
env:
REF: ${{ github.ref }}
RUN: ${{ github.run_id }}
PUSH_ID: ${{ github.event.push_id }}
GH_TAIL_REF: ${{ github.event.before }}
GIT_API_KEY: ${{ secrets.GH_GITHUB_API_KEY }}
GIT_USER_NAME: ${{ secrets.GH_AUTO_USER }}
GIT_USER_EMAIL: ${{ secrets.GH_AUTO_EMAIL }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Make repatriate branch
shell: bash
run: |
set -x
git config --global user.email "$GIT_USER_EMAIL"
git config --global user.name "$GIT_USER_NAME"
git config --global "url.https://[email protected]" https://github.com
git checkout -b ci-repatriate-changes-${RUN} origin/release/v1.14
git cherry-pick ${GH_TAIL_REF}..${GITHUB_REF} --allow-empty
git push --set-upstream origin ci-repatriate-changes-${RUN}
- name: Repatriate branch PR
shell: bash
run: |
set -x
echo "${GIT_API_KEY}" > temp_credential
# GH does NOT want this in the env
export GIT_API_KEY=
cat temp_credential | gh auth login --with-token
rm temp_credential
gh pr create --title "[CI] repatriate changes job ${RUN}" \
--body "This PR contains changes from push to master ${REF}" \
--base release/v1.14 \
--reviewer "kflynn,aidanhahn,lukeshu,anodelman"
- name: Slack notification
if: always()
uses: edge/simple-slack-notify@master
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
status: ${{ job.status }}
success_text: "Created repatriation PR for push to master"
failure_text: "Couldn\'t cleanly repatriate changes for push to master"
fields: |
[{ "title": "Repository", "value": "${env.GITHUB_REPOSITORY}", "short": true },
{ "title": "Branch", "value": "${env.GITHUB_REF}", "short": true}]