-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.44 KB
/
yarn-upgrade.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
name: Yarn Upgrade
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
yarn_dedupe:
name: "Yarn upgrade"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Yarn set latest version
run: |
yarn set version latest --yarn-path
- name: Detect version changes
id: verify_diff
run: |
git diff --quiet . || echo "deduped_changes=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.verify_diff.outputs.deduped_changes == 'true'
run: |
export YARN_VERSION="$(yarn --version)"
git checkout -B "yarn_upgrade/$YARN_VERSION"
git config user.name "Joris Aerts"
git config user.email "[email protected]"
git add --al
git commit -a -m "Bump Yarn to $YARN_VERSION"
git push --set-upstream origin "yarn_upgrade/$YARN_VERSION"
- name: Create pull request
if: steps.verify_diff.outputs.deduped_changes == 'true'
run: |
export YARN_VERSION="$(yarn --version)"
export UPGRADE_BRANCH="yarn_upgrade/$YARN_VERSION"
gh pr create -B main -H "$UPGRADE_BRANCH" --title "Bump Yarn to $YARN_VERSION" --body "Bump Yarn to version $YARN_VERSION" --label "dependencies"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}