name: Update Docs Lockfile on: pull_request_target: paths: - 'docs/package.json' permissions: contents: read jobs: update-lockfile: runs-on: ubuntu-latest if: github.event.pull_request.user.login == 'dependabot[bot]' steps: - uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 id: app-token with: client-id: ${{ vars.CLIENT_ID }} private-key: ${{ secrets.PRIVATE_KEY }} - name: Set git config run: | git config --global user.email "github-actions@github.com" git config --global user.name "github-actions" git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf https://github.com/ env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - name: Checkout PR branch uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: token: ${{ steps.app-token.outputs.token }} ref: ${{ github.event.pull_request.head.ref }} persist-credentials: false # Avoid `cache: 'pnpm'`: this workflow runs under pull_request_target # trust, and the pnpm cache key in actions/install-dependencies collides # with main-branch workflows. - name: Install pnpm uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: # Install the version the docs pin in `packageManager` package_json_file: docs/package.json - name: Setup Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: lts/* - name: Update Docs Lockfile working-directory: ./docs/ run: pnpm install --ignore-workspace --no-frozen-lockfile --ignore-scripts - name: Commit and Push run: | git add docs/pnpm-lock.yaml if git diff --cached --quiet; then echo "No lockfile changes to commit" else git commit -m "Update docs lockfile" git push fi