DRAFT PNPM sync with Master #1831
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pnpm-deduplicate | |
on: | |
pull_request: | |
paths: | |
- "pnpm-lock.yaml" | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
deployments: read | |
pull-requests: write # needed to write comment in PR | |
jobs: | |
dedupe: | |
runs-on: ubuntu-latest | |
name: Deduplicate | |
environment: pull_request_unsafe | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Use Node.js | |
uses: ./.github/actions/setup-node | |
- name: pnpm-deduplicate | |
id: deduplicate | |
run: | | |
pnpm dedupe --ignore-scripts | |
echo "::set-output name=diff::$(git status --short pnpm-lock.yaml)" | |
- name: Commit dedupe | |
if: steps.deduplicate.outputs.diff | |
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 #1.4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: "chore: pnpm-deduplicate" | |
branch: ${{ github.head_ref }} |