Skip to content

Commit

Permalink
ci: add action to update lockfile (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Nov 15, 2024
1 parent 8c5649f commit de91b7a
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 147 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Lockfile

on:
issue_comment:
types:
- created

permissions:
contents: write
issues: read

jobs:
update-lockfile:
if: >
github.event.comment.body == '!lock' &&
github.event.issue.pull_request != null
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout PR branch
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.event.issue.pull_request.head.ref }}
repository: ${{ github.event.repository.full_name }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
check-latest: true
registry-url: "https://registry.npmjs.org"
node-version: latest

- name: Install pnpm
run: npm install -g pnpm

- name: Update dependencies
run: pnpm i --no-frozen-lockfile

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update lockfile"
Loading

0 comments on commit de91b7a

Please sign in to comment.