Skip to content

🧐 Embed AP Compute Quicksight within Control Panel #1188

🧐 Embed AP Compute Quicksight within Control Panel

🧐 Embed AP Compute Quicksight within Control Panel #1188

---
name: Create epic label
on: # yamllint disable-line rule:truthy
issues:
types:
- labeled
concurrency:
group: create-epic-label
cancel-in-progress: true
permissions: read-all
jobs:
create-epic-label:
if: github.event.label.name == 'Epic'
name: Create epic label
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create epic label
id: create_epic_label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueTitle = context.payload.issue.title;
const issueNumber = context.payload.issue.number;
const labelName = `${issueTitle} (Epic #${issueNumber})`;
const labels = context.payload.issue.labels;
// Generate a random 6-digit hexadecimal color
const randomColor = Math.floor(Math.random()*16777215).toString(16);
// Check if label already exists
const existingLabels = await github.paginate(github.rest.issues.listLabelsForRepo, {
owner: context.repo.owner,
repo: context.repo.repo
});
if (!existingLabels.find(label => label.name === labelName)) {
// Label doesn't exist, create it
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: randomColor
});
}