forked from TimesysGit/meta-timesys
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.48 KB
/
update.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Update Real Remote to Fork
on:
workflow_dispatch:
schedule:
# run every night @ 01:00 am
- cron: '1 0 * * *'
jobs:
fetch-updates:
runs-on: ubuntu-latest
environment: upstream-link
strategy:
fail-fast: false
matrix:
branch_name:
- dunfell
- kirkstone
- scarthgap
- master
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch_name }}
submodules: recursive
fetch-depth: 0
- name: Update
run: |
git fetch -p origin
git checkout ${{ matrix.branch_name }}
# Note: upstream needs to point to the origin repo
git remote add upstream "${{ vars.UPSTREAM_URL }}"
git fetch -p upstream
if git diff --quiet origin/${{ matrix.branch_name }}..upstream/${{ matrix.branch_name }}; then
echo "No changes detected"
exit 0
fi
git rebase upstream/${{ matrix.branch_name }}
- name: Push Updates
id: push-branch
run: |
git config --global user.email "[email protected]"
git config --global user.name "Device Platform GitHub Bot"
git push
- name: Post job success status to slack
if: ${{ success() }}
uses: slackapi/[email protected]
with:
# device-platform-newsfeed
channel-id: 'GQ968L7RC'
# For posting a simple plain text message
slack-message: |
${{ github.repository }}: ${{ github.workflow }}: ${{ job.status }}
Branch: ${{ matrix.branch_name }}
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Post job failure status to slack
if: ${{ ! success() }}
uses: slackapi/[email protected]
with:
# device-platform-newsfeed
channel-id: 'GQ968L7RC'
# For posting a simple plain text message
slack-message: |
${{ github.repository }}: ${{ github.workflow }}: *${{ job.status }}*
Branch: ${{ matrix.branch_name }}
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
<@UCUGH2DGQ>
# dennis
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}