Skip to content

Commit

Permalink
Add workflow to copy Resolutions to Overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky authored Apr 23, 2022
1 parent cfd23ba commit a1d3da8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/copy-resolutions-to-overrides.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a1d3da8

Please sign in to comment.