generated from giantswarm/template-app
-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (35 loc) · 1.19 KB
/
update-from-fork.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
name: Update from fork
on:
schedule:
- cron: '0 8 */7 * *' # At 08:00 on every 7th day-of-month
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
env:
fork_repo: https://github.com/giantswarm/falco-charts-upstream
branch: 'main#update-chart'
jobs:
sync-app-with-fork:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: |
# Get the last tag from fork repo
LAST_TAG=$(git ls-remote --tags --sort='v:refname' --refs $fork_repo \
| tail -1 | cut -d '/' -f3)
echo "Last tag found is $LAST_TAG"
# Setup git config
git config user.name github-actions
git config user.email [email protected]
git checkout -b $branch
# Modify the version in Vendir config
sed -i -r "s/(ref:).*/\1 $LAST_TAG/g" vendir.yml
git add vendir.yml
git commit -m "Update app version from fork repo"
git push origin $branch
call-update-chart:
uses: ./.github/workflows/zz_generated.update_chart.yaml
needs: sync-app-with-fork
secrets: inherit
with:
branch: 'main#update-chart'