|
| 1 | +name: Update Yarn |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 10 15 * *' # Runs every 15th of the month |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + open-update-pr: |
| 10 | + name: "Open Update PR" |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + token: ${{ secrets.REPO_ACCESS_TOKEN }} |
| 16 | + - uses: actions/setup-node@v4 |
| 17 | + with: |
| 18 | + node-version: '20' |
| 19 | + - name: Enable Corepack |
| 20 | + run: corepack enable |
| 21 | + |
| 22 | + - name: Get short hash |
| 23 | + id: short-sha |
| 24 | + run: echo "short=$(openssl rand -hex 6)" >> $GITHUB_OUTPUT |
| 25 | + |
| 26 | + - name: Update yarn in web |
| 27 | + working-directory: ./web |
| 28 | + run: yarn set version stable |
| 29 | + - name: Install yarn in web |
| 30 | + working-directory: ./web |
| 31 | + run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install |
| 32 | + |
| 33 | + - name: Update yarn in graphql-server |
| 34 | + working-directory: ./graphql-server |
| 35 | + run: yarn set version stable |
| 36 | + - name: Install yarn in graphql-server |
| 37 | + working-directory: ./graphql-server |
| 38 | + run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install |
| 39 | + |
| 40 | + - name: Update yarn in workbench-cypress |
| 41 | + working-directory: ./workbench-cypress |
| 42 | + run: yarn set version stable |
| 43 | + - name: Install yarn in workbench-cypress |
| 44 | + working-directory: ./workbench-cypress |
| 45 | + run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install |
| 46 | + |
| 47 | + - name: Create and Push new branch |
| 48 | + run: | |
| 49 | + git config --global --add user.name "tbantle22" |
| 50 | + git config --global --add user.email "[email protected]" |
| 51 | + branchname=${{ format('update-yarn-{0}', steps.short-sha.outputs.short) }} |
| 52 | + git checkout -b "$branchname" |
| 53 | + git add . |
| 54 | + git commit -m "Update yarn" |
| 55 | + git push origin "$branchname" |
| 56 | + |
| 57 | + - name: Create pull request |
| 58 | + uses: repo-sync/pull-request@v2 |
| 59 | + id: latest-pr |
| 60 | + with: |
| 61 | + source_branch: ${{ format('update-yarn-{0}', steps.short-sha.outputs.short) }} |
| 62 | + destination_branch: "main" |
| 63 | + github_token: ${{ secrets.REPO_ACCESS_TOKEN }} |
| 64 | + pr_title: "Update yarn" |
| 65 | + pr_reviewer: tbantle22 |
| 66 | + pr_label: "dependencies" |
0 commit comments