From 251c3868e863072c36edf4233e1a24086960d2bd Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Fri, 2 Apr 2021 08:57:15 -0700 Subject: [PATCH] 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 --- .changeset/twelve-cameras-drive.md | 5 +++++ .github/workflows/labeler.yml | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .changeset/twelve-cameras-drive.md create mode 100644 .github/workflows/labeler.yml diff --git a/.changeset/twelve-cameras-drive.md b/.changeset/twelve-cameras-drive.md new file mode 100644 index 00000000..e7f60b40 --- /dev/null +++ b/.changeset/twelve-cameras-drive.md @@ -0,0 +1,5 @@ +--- +'@primer/css': patch +--- + +Label workflow diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..dcd005bb --- /dev/null +++ b/.github/workflows/labeler.yml @@ -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] + }