1
1
mirror of https://github.com/primer/css.git synced 2024-11-28 04:43:05 +03:00

Creating a label workflow

id is part of step

matching changeset

syntax error

zero index

output

unfurl

log match

multiline

match[1]

match[0]

unfurl

match 0 1

remove log
This commit is contained in:
Jon Rohan 2021-04-02 08:57:15 -07:00
parent a71def926f
commit 251c3868e8
No known key found for this signature in database
GPG Key ID: B0BBE304A9A0AECB
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'@primer/css': patch
---
Label workflow

21
.github/workflows/labeler.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Labeler
on:
pull_request:
types: [opened, synchronize, edited]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
id: version-result
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
result-encoding: string
script: |
const diff_url = context.payload.pull_request.diff_url
const result = await github.request(diff_url)
const match = [...result.data.matchAll(/^\+'@primer\/css':\s(patch|minor|major)/m)]
if (match) {
return match[0][1]
}