Skip to content

Collapsed factory summary surplus not accounting for internal materials #635

Collapsed factory summary surplus not accounting for internal materials

Collapsed factory summary surplus not accounting for internal materials #635

name: "Issue Management"
on:
issues:
types: [opened, labeled, unlabeled]
jobs:
manage-issues:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: New issue, add Needs Triage label
if: github.event.action == 'opened'
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Needs Triage']
})
- name: P1 Label added
if: github.event.action == 'labeled' && contains(github.event.label.name, 'P1')
uses: actions/github-script@v7
with:
script: |
const label = context.payload.label.name;
if (label === 'P1') {
const issue = context.issue;
if (labels.data.some(l => l.name === 'Needs Triage')) {
await github.rest.issues.removeLabel({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Needs Triage'
});
}
}
- name: P1 Label removed
if: github.event.action == 'unlabeled'
uses: actions/github-script@v7
with:
script: |
const label = context.payload.label.name;
if (label === 'P1') {
const issue = context.issue;
if (labels.data.some(l => l.name === 'Needs Triage')) {
await github.rest.issues.removeLabel({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Needs Triage'
});
}
}
- name: P2 or P3 Label added, Remove Needs Triage label
if: github.event.action == 'labeled' && (contains(github.event.label.name, 'P2') || contains(github.event.label.name, 'P3'))
uses: actions/github-script@v7
with:
script: |
const issue = context.issue;
if (labels.data.some(l => l.name === 'Needs Triage')) {
await github.rest.issues.removeLabel({
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Needs Triage'
});
}