diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-07-07 01:11:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-07 01:11:24 +0200 |
commit | 6b76ba0b899b4a733955f9f18c8382de7d6b5b87 (patch) | |
tree | dcb1b74e7623d994587761d48542589d90884b11 /.github/workflows | |
parent | 1ae710a4e6db9ee0ae3d4299e1b5967d72bb4e11 (diff) | |
download | skyhanni-6b76ba0b899b4a733955f9f18c8382de7d6b5b87.tar.gz skyhanni-6b76ba0b899b4a733955f9f18c8382de7d6b5b87.tar.bz2 skyhanni-6b76ba0b899b4a733955f9f18c8382de7d6b5b87.zip |
Internal: Bug Fix Label action (#2197)
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/label-bug-fix.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/label-bug-fix.yml b/.github/workflows/label-bug-fix.yml new file mode 100644 index 000000000..23ca3af81 --- /dev/null +++ b/.github/workflows/label-bug-fix.yml @@ -0,0 +1,40 @@ +name: "Bug Fix label" +on: + pull_request: + types: [ opened,edited ] +jobs: + assign-label: + runs-on: ubuntu-latest + steps: + - name: label + env: + TITLE: ${{ github.event.pull_request.title }} + LABEL: Bug Fix - Sooner than Very Soon + uses: actions/github-script@v7 + with: + script: | + if(process.env.TITLE.split(":")[0].toUpperCase().includes("FIX")){ + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [process.env.LABEL] + }) + }else{ + const {data} = await github.rest.issues.listLabelsOnIssue({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + }) + const filtered = data.filter(label => label.name == process.env.LABEL) + if(filtered.length == 1){ + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.LABEL + }) + } + } + + |