Skip to content

Commit ae70e0d

Browse files
authored
Add GitHub Actions workflow for auto approving PRs (#240)
1 parent e531669 commit ae70e0d

54 files changed

Lines changed: 3211 additions & 8102 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ github: [nevware21] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g
1010
#issuehunt: # Replace with a single IssueHunt username
1111
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
1212
#polar: # Replace with a single Polar username
13-
#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
13+
buy_me_a_coffee: nevware21 # Replace with a single Buy Me a Coffee username
1414
#thanks_dev: # Replace with a single thanks.dev username
1515
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/ci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,33 @@ jobs:
1818

1919
strategy:
2020
matrix:
21-
node-version: [ 12, 14, 16, 18 ]
21+
node: [ 16, 18, 20, 22 ]
2222
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2323

2424
steps:
25-
- uses: actions/checkout@v3
26-
- name: Use Node.js ${{ matrix.node_version }}
27-
uses: actions/setup-node@v3
25+
- uses: actions/checkout@v6
26+
- name: Use Node.js ${{ matrix.node }}
27+
uses: actions/setup-node@v6
2828
with:
29-
node-version: ${{ matrix.node_version }}
30-
- run: npm install
29+
node-version: ${{ matrix.node }}
30+
31+
- name: Update rush shrinkwrap dependencies
32+
run: node common/scripts/install-run-rush.js update --full
33+
34+
- name: Npm Install
35+
run: npm install
36+
3137
- name: Build
3238
run: npm run build --verbose
33-
timeout-minutes: 10
39+
timeout-minutes: 15
40+
3441
- name: Unit tests
35-
run: npm run test --verbose
36-
- name: Report Coverage
37-
run: npm run codecov
42+
run: node common/scripts/install-run-rush.js test --verbose
43+
timeout-minutes: 15
44+
45+
- name: Upload Coverage
46+
uses: codecov/codecov-action@v5
47+
with:
48+
files: ./coverage/coverage-final.json
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v6
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
46+
uses: github/codeql-action/init@v4
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
57+
uses: github/codeql-action/autobuild@v4
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v2
71+
uses: github/codeql-action/analyze@v4
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Dependabot Auto Approve
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
9+
permissions:
10+
pull-requests: write
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
15+
cancel-in-progress: true
16+
jobs:
17+
auto-approve:
18+
runs-on: ubuntu-latest
19+
if: github.actor == 'dependabot[bot]' || github.actor == 'nev21'
20+
steps:
21+
- name: Wait for status checks
22+
uses: lewagon/wait-on-check-action@v1.4.1
23+
with:
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
wait-interval: 30
27+
running-workflow-name: 'auto-approve'
28+
allowed-conclusions: success,skipped,neutral
29+
30+
- name: Approve PR
31+
if: success()
32+
run: gh pr review --approve "$PR_URL"
33+
env:
34+
PR_URL: ${{ github.event.pull_request.html_url }}
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ to your application or libraries. The support is all built and tested using Type
1414
primary focuses of this package is to provide support for the creation of code that can be better minified, resulting in a smaller runtime payload which can directly assist with Page Load performance.
1515

1616
### Test Environments
17-
- Node (12, 14, 16, 18)
17+
- Node (16, 18, 20, 22)
1818
- Browser (Chromium - headless)
1919
- Web Worker (Chromium - headless)
2020

common/config/rush/command-line.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@
7171
"enableParallelism": false,
7272
"ignoreMissingScript": false,
7373
"allowWarningsInSuccessfulBuild": true
74-
},
75-
{
76-
"commandKind": "bulk",
77-
"summary": "Run all codecov targets for all packages",
78-
"name": "codecov",
79-
"description": "Runs codecov for all projects",
80-
"safeForSimultaneousRushProcesses": false,
81-
"enableParallelism": false,
82-
"ignoreMissingScript": false,
83-
"allowWarningsInSuccessfulBuild": true
8474
}
8575
]
8676
}

0 commit comments

Comments
 (0)