forked from datengaertnerei/test-data-service
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.95 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
name: update-data
concurrency: dev-build
on:
workflow_dispatch
#schedule:
# * is a special character in YAML so you have to quote this string
#- cron: '30 2 10 3,6,9,12 *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@9ff9d14760a73102d9fa2f47131624137f50ead8
with:
disable-sudo: true
egress-policy: audit #outbound hosts constantly subject to change by action providers
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: 3.x
- name: Fetch data
run: |
git checkout -B update-data
cd src/tools
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python blz_fetcher.py
wc -l banklist.csv
if [[ $(wc -l < banklist.csv) -ge 100 ]];then
mv banklist.csv ../main/resources/com/datengaertnerei/test/dataservice/bank
git config --global user.email "[email protected]"
git config --global user.name "datengaertnerei"
git commit -m "Action commit: new bank data" ../main/resources/com/datengaertnerei/test/dataservice/bank
git push --set-upstream origin update-data
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create pull request - must run with a different GH token to allow merge check action trigger
- name: Create pull request to dev
id: cpr_dev
run: gh pr create --base $BASE --head $HEAD --title "$TITLE" --body "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.REL_SECRET }}
HEAD: update-data
BASE: develop
TITLE: "Merge updated data to dev"
BODY: ":crown: *An automated PR*"