chore: Fix yarn upgrader

imgbot
Kieran 2023-01-09 09:58:27 +00:00 committed by GitHub
parent db1b81e895
commit f0f15b2cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 55 deletions

View File

@ -1,69 +1,28 @@
name: " 🔗 Update Dependencies Main"
name: Run Yarn Upgrader
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 12 * * 0"
- cron: '0 */12 * * *'
jobs:
update-dependencies:
build:
runs-on: ubuntu-latest
env:
NEW_BRANCH: "update-dependencies-main"
REF_BRANCH: main
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ env.REF_BRANCH }}
- uses: actions/checkout@v3.3.0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v3.6.0
with:
cache: yarn
node-version: 19.x
- name: Update
run: |
yarn
yarn upgrade
- name: update package.json
run: |
npx package-json-dependency-updater -u
- name: Install
run: |
yarn
# Run `yarn upgrade`
- uses: browniebroke/yarn-upgrade-action@v1.1
- name: Lint
run: |
yarn lint
- name: Has changes
run: |
git --no-pager diff --compact-summary --exit-code && echo "git_status=clean" >> $GITHUB_ENV || echo "git_status=dirty" >> $GITHUB_ENV
git --no-pager diff --compact-summary
- name: Gen Body
run: |
echo 'git_body<<DIFF' >> $GITHUB_ENV
git --no-pager diff --compact-summary >> $GITHUB_ENV
echo 'DIFF' >> $GITHUB_ENV
- name: Echo git_status
run: echo ${{ env.git_status }}
- uses: tibdex/github-app-token@v1.7 # cspell:ignore tibdex
if: env.git_status == 'dirty'
id: generate-token
with:
app_id: ${{ secrets.AUTOMATION_APP_ID }}
private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
# Open a pull request if there are any changes
- name: Create Pull Request
if: env.git_status == 'dirty'
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v4.2.3
with:
commit-message: "ci: Workflow Bot -- Update ALL Dependencies"
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: "ci: Workflow Bot -- Update ALL Dependencies (${{ env.REF_BRANCH }})"
token: ${{ steps.generate-token.outputs.token }}
body: ${{ env.git_body }}
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/yarn-upgrade
title: 'chore(deps): Run yarn upgrade'
commit-message: 'chore(deps): Run yarn upgrade'