-
Notifications
You must be signed in to change notification settings - Fork 46
57 lines (51 loc) · 2.22 KB
/
update-israeli-bank-scrapers.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: Update israeli-bank-scrapers
on:
schedule:
- cron: '0 0 * * *'
# Manual trigger
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Get old version
id: get_old_version
run: |
old_version=$(yarn list --pattern israeli-bank-scrapers-core --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name' | cut -d'@' -f2)
echo "old_version=${old_version}" >> $GITHUB_OUTPUT
- name: Install dependencies
run: yarn install
- name: Upgrade israeli-bank-scrapers-core
run: |
yarn upgrade israeli-bank-scrapers-core --latest
- name: Get new version
id: get_new_version
run: |
new_version=$(yarn list --pattern israeli-bank-scrapers-core --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name' | cut -d'@' -f2)
echo "new_version=${new_version}" >> $GITHUB_OUTPUT
- name: Generate diff link
id: diff_link
run: |
echo "diff_link=https://github.com/eshaham/israeli-bank-scrapers/compare/v${{ steps.get_old_version.outputs.old_version }}...v${{ steps.get_new_version.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Create pull request
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: 'deps/israeli-bank-scrapers-core'
base: 'master'
delete-branch: true # Delete the branch after the pull request is closed
commit-message: 'Deps: Upgrade israeli-bank-scrapers to ${{ steps.get_new_version.outputs.new_version }}'
title: 'Deps: Upgrade israeli-bank-scrapers to ${{ steps.get_new_version.outputs.new_version }}'
body: |
Upgrade israeli-bank-scrapers-core library to ${{ steps.get_new_version.outputs.new_version }}
Changes:
- [Diff Link](${{ steps.diff_link.outputs.diff_link }})