Skip to content

Commit

Permalink
Merge pull request #160 from adamstankiewicz/ags/browserslist-db-auto…
Browse files Browse the repository at this point in the history
…mation

fix: refactor update-browserslist-db to auto-approve PR and auto-merge with `gh` CLI
  • Loading branch information
feanil authored Jan 6, 2025
2 parents baada43 + 2e7b739 commit 1b572d7
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/update-browserslist-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@ on:
jobs:
update-dep:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
npm: [8.5.x]

steps:
- name: Check out the repo
- name: Checkout the repo
uses: actions/checkout@v4
- name: Install node

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
run: npm install -g npm@${{ matrix.npm }}
node-version-file: '.nvmrc'

- name: Install Packages
- name: Install Dependencies
run: npm ci

- name: Update dependencies
- name: Update browserslist DB
run: npx update-browserslist-db@latest

- name: Create Pull Request
Expand All @@ -42,10 +34,13 @@ jobs:
Updated browserslist DB
branch: update-browserslist-db

- name: Enable Pull Request Automerge
- name: Auto-approve Pull Request
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.requirements_bot_github_token }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.requirements_bot_github_token }}

- name: Enable Pull Request Automerge
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.requirements_bot_github_token }}

0 comments on commit 1b572d7

Please sign in to comment.