Skip to content

feat(audience): auto-collect Epic account ID and detect Epic platform #589

feat(audience): auto-collect Epic account ID and detect Epic platform

feat(audience): auto-collect Epic account ID and detect Epic platform #589

Workflow file for this run

---
name: PR Labeler
on:
pull_request:
types: [closed]
permissions:
contents: read
jobs:
pr-labeler:
permissions:
contents: read
pull-requests: write
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler/config.yml
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const files = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
})
const isAudience = files.data.some(f =>
f.filename.startsWith('src/Packages/Audience/')
)
if (!isAudience) return
const branch = context.payload.pull_request.head.ref
let label = 'audience-chore'
if (branch.startsWith('feat/')) label = 'audience-feature'
else if (branch.startsWith('fix/')) label = 'audience-fix'
else if (branch.startsWith('perf/')) label = 'audience-performance'
else if (branch.startsWith('docs/')) label = 'audience-docs'
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: [label],
})