|
| 1 | +name: Update pnpm Version |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: '0 23 * * 4' # Weekly on Thursday afternoons (UTC) |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + update-pnpm: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v6 |
| 12 | + - uses: pnpm/action-setup@v4 |
| 13 | + - name: Setup Node.js |
| 14 | + uses: actions/setup-node@v6 |
| 15 | + with: |
| 16 | + node-version: 24 |
| 17 | + - name: Get latest pnpm version |
| 18 | + run: | |
| 19 | + PNPM_VERSION="$(npm view pnpm version)" # get the latest version of pnpm from the registry |
| 20 | + echo ${PNPM_VERSION} |
| 21 | + echo "pnpm_version=${PNPM_VERSION}" >> $GITHUB_ENV |
| 22 | + - name: Update package.json |
| 23 | + run: | |
| 24 | + jq '.packageManager = "pnpm@'"${{ env.pnpm_version }}"'"' package.json > temp.json |
| 25 | + mv temp.json package.json |
| 26 | + - name: Create Pull Request |
| 27 | + id: cpr |
| 28 | + uses: peter-evans/create-pull-request@v8 |
| 29 | + with: |
| 30 | + token: ${{ secrets.ZORGBORT_TOKEN }} |
| 31 | + commit-message: Update PNPM to v${{ env.pnpm_version }} |
| 32 | + title: Update PNPM to v${{ env.pnpm_version }} |
| 33 | + body: | |
| 34 | + Update PNPM to v${{ env.pnpm_version }} the latest release. |
| 35 | + Auto-generated by [update-pnpm-version][1] |
| 36 | +
|
| 37 | + [1]: https://github.com/ilios/iliosproject.org/.github/workflows/update-pnpm-version.yml |
| 38 | + branch: update-pnpm-version |
| 39 | + labels: dependencies |
| 40 | + - name: Approve Pull Request |
| 41 | + if: steps.cpr.outputs.pull-request-operation == 'created' |
| 42 | + run: gh pr review --approve -b "Auto Approved" ${{ steps.cpr.outputs.pull-request-number }} |
| 43 | + env: |
| 44 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + - name: Enable Pull Request Automerge and Label |
| 46 | + if: steps.cpr.outputs.pull-request-operation == 'created' |
| 47 | + run: | |
| 48 | + gh pr edit --add-label "dependencies" ${{ steps.cpr.outputs.pull-request-number }} |
| 49 | + gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-number }} |
| 50 | + env: |
| 51 | + GH_TOKEN: ${{ secrets.ZORGBORT_TOKEN }} |
| 52 | + - uses: act10ns/slack@v2 |
| 53 | + if: failure() |
| 54 | + env: |
| 55 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }} |
| 56 | + with: |
| 57 | + status: ${{ job.status }} |
| 58 | + message: Update PNPM Job Failed for website {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }} |
0 commit comments