diff --git a/.github/workflows/copy-resolutions-to-overrides.yml b/.github/workflows/copy-resolutions-to-overrides.yml new file mode 100644 index 0000000..a44a2a6 --- /dev/null +++ b/.github/workflows/copy-resolutions-to-overrides.yml @@ -0,0 +1,35 @@ +name: Copy Yarn Resolutions to npm Overrides + +on: + push: + branches: + # Match every branch except for main + - '**' + - '!main' + +jobs: + build: + name: Copy Yarn Resolutions to npm Overrides + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # To trigger further `on: [push]` workflow runs + # Ref: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + # Ref: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Copy "resolutions" object to "overrides" in package.json + run: yq --inplace --output-format=json '.overrides = .resolutions' package.json + + - name: Install any updated dependencies + run: npm install + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Update Overrides from Resolutions