Skip to content

Bump github/codeql-action from 2.22.5 to 3.28.15 #1753

Bump github/codeql-action from 2.22.5 to 3.28.15

Bump github/codeql-action from 2.22.5 to 3.28.15 #1753

Workflow file for this run

# https://docs.github.com/en/actions
name: "Labeler"
on:
workflow_dispatch:
pull_request_target:
types:
- "opened"
jobs:
label:
name: "Label"
runs-on: "ubuntu-latest"
steps:
- name: "Add labels based on branch name"
uses: "actions/github-script@v6"
with:
github-token: ${{secrets.FULL_P_TOKEN}}
script: |
const branchPrefixLabels = {
github: "GitHub Actions",
}
const pullRequest = context.payload.pull_request
const repository = context.repo
const branchName = pullRequest.head.ref
const matches = branchName.match(new RegExp('^([^/]+)\/'));
if (matches instanceof Array && branchPrefixLabels.hasOwnProperty(matches[1])) {
const label = branchPrefixLabels[matches[1]]
github.issues.addLabels({
issue_number: pullRequest.number,
labels: [
label
],
owner: repository.owner,
repo: repository.repo,
});
}