Skip to content

Chore add label on pr #14

Chore add label on pr

Chore add label on pr #14

Workflow file for this run

name: "Add labels"
on:
pull_request:
permissions:
pull-requests: write
jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process')
const { commits } = context.payload.pull_request
const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString()
const files = rawFiles.split('\n').filter(Boolean)
const ignoredPackage = 'mix_lint_test'
const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('ignoredPackages'))
const packages = packagesFiles.map(file => file.split('/')[1])
const uniquePackages = new Set(packages)
console.log(Array.from(uniquePackages))
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: Array.from(uniquePackages)
})