Skip to content

Commit c45364e

Browse files
Add pnpm version update workflow (#57) (#58)
1 parent 7e44df2 commit c45364e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/update-pnpm.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Update pnpm Version and Auto-Merge
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-pnpm:
14+
runs-on: ubuntu-latest
15+
16+
outputs:
17+
pull_request_url: ${{ steps.create-pr.outputs.pull-request-url }}
18+
19+
steps:
20+
- name: Check out the repository
21+
uses: actions/checkout@v3
22+
23+
- name: Install Corepack
24+
run: npm install -g corepack
25+
26+
- name: Update pnpm Version
27+
run: corepack up
28+
29+
- name: Create a pull request
30+
id: create-pr
31+
uses: peter-evans/create-pull-request@v5
32+
with:
33+
branch: update-pnpm-version
34+
title: "chore: Update pnpm version via Corepack"
35+
body: "This pull request updates the pnpm version in package.json using Corepack."
36+
labels: update, dependencies
37+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
38+
39+
auto-merge:
40+
needs: update-pnpm
41+
runs-on: ubuntu-latest
42+
if: needs.update-pnpm.outputs.pull_request_url != ''
43+
44+
steps:
45+
- name: Enable auto-merge for the pull request
46+
run: gh pr merge --auto --merge "${{ needs.update-pnpm.outputs.pull_request_url }}"
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)