Upgrade: Bump @types/react in /document-conversion #3
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: Upgrade Dependency on PR Approval | ||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
branches: | ||
- main # or your default branch | ||
jobs: | ||
update-dependency: | ||
if: github.event.review.state == 'approved' && startsWith(github.event.pull_request.title, 'Upgrade: Bump ') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Update package.json | ||
run: | | ||
PACKAGE_NAME=$(echo ${{ github.event.pull_request.title }} | cut -d ' ' -f 3) | ||
PACKAGE_VERSION=$(echo ${{ github.event.pull_request.title }} | cut -d ' ' -f 5) | ||
npm install $PACKAGE_NAME@$PACKAGE_VERSION --save-exact | ||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git add package.json package-lock.json | ||
git commit -m "Update dependency: $PACKAGE_NAME to $PACKAGE_VERSION" | ||
git push |