From f0f15b2cc8f1acc48ee3ba16f9b341f0fcef4273 Mon Sep 17 00:00:00 2001 From: Kieran <32241933+KieranRobson@users.noreply.github.com> Date: Mon, 9 Jan 2023 09:58:27 +0000 Subject: [PATCH] chore: Fix yarn upgrader --- .github/workflows/yarn-upgrader.yml | 69 ++++++----------------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/.github/workflows/yarn-upgrader.yml b/.github/workflows/yarn-upgrader.yml index 88ea4f6..22fe5a2 100644 --- a/.github/workflows/yarn-upgrader.yml +++ b/.github/workflows/yarn-upgrader.yml @@ -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<> $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 - \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + branch: update/yarn-upgrade + title: 'chore(deps): Run yarn upgrade' + commit-message: 'chore(deps): Run yarn upgrade'