File tree Expand file tree Collapse file tree 3 files changed +29
-8
lines changed
Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 1+ name : ' Conventional Commit'
2+
3+ on :
4+ pull_request_target :
5+ types :
6+ # Defaults
7+ # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
8+ - opened
9+ - reopened
10+ - synchronize
11+ # Tracks editing PR title or description, or base branch changes
12+ # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request
13+ - edited
14+
15+ jobs :
16+ main :
17+ name : ' [Required] Validate PR title'
18+ runs-on : ubuntu-latest
19+ permissions :
20+ pull-requests : read
21+ steps :
22+ - uses : amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
23+ env :
24+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1010
1111jobs :
1212 check-format :
13+ name : ' [Required] Check correct format'
1314 runs-on : ubuntu-latest
1415
1516 steps :
3132 run : npm run check-format
3233
3334 check-docs :
35+ name : ' [Required] Check docs updated'
3436 runs-on : ubuntu-latest
3537
3638 steps :
Original file line number Diff line number Diff line change 77export class Mutex {
88 static Guard = class Guard {
99 #mutex: Mutex ;
10- #onRelease?: ( ) => void ;
11- constructor ( mutex : Mutex , onRelease ?: ( ) => void ) {
10+ constructor ( mutex : Mutex ) {
1211 this . #mutex = mutex ;
13- this . #onRelease = onRelease ;
1412 }
1513 dispose ( ) : void {
16- this . #onRelease?.( ) ;
1714 return this . #mutex. release ( ) ;
1815 }
1916 } ;
@@ -22,17 +19,15 @@ export class Mutex {
2219 #acquirers: Array < ( ) => void > = [ ] ;
2320
2421 // This is FIFO.
25- async acquire (
26- onRelease ?: ( ) => void ,
27- ) : Promise < InstanceType < typeof Mutex . Guard > > {
22+ async acquire ( ) : Promise < InstanceType < typeof Mutex . Guard > > {
2823 if ( ! this . #locked) {
2924 this . #locked = true ;
3025 return new Mutex . Guard ( this ) ;
3126 }
3227 const { resolve, promise} = Promise . withResolvers < void > ( ) ;
3328 this . #acquirers. push ( resolve ) ;
3429 await promise ;
35- return new Mutex . Guard ( this , onRelease ) ;
30+ return new Mutex . Guard ( this ) ;
3631 }
3732
3833 release ( ) : void {
You can’t perform that action at this time.
0 commit comments