Skip to content

.github/workflows/released_or_not.yml #3

.github/workflows/released_or_not.yml

.github/workflows/released_or_not.yml #3

on:
issue_comment:
types: [created]
jobs:
not-released:
runs-on: ubuntu-latest
steps:
- name: Check for /notreleased command
uses: actions/github-script@v7
with:
script: |
const comment = context.payload.comment.body;
if (comment.startsWith('/notreleased ')) {
return 'not released';
} else {
return null;
}
result-encoding: string
id: get-label
- uses: actions/github-script@v7
if: steps.get-label.outputs.result != 'null'
with:
script: |
const label = '${{ steps.get-label.outputs.result }}';
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label]
})
released:
runs-on: ubuntu-latest
steps:
- name: Check for /released command
uses: actions/github-script@v7
with:
script: |
const comment = context.payload.comment.body;
if (comment.startsWith('/released ')) {
return 'released';
} else {
return null;
}
result-encoding: string
id: released
- uses: actions/github-script@v7
if: steps.released.outputs.result != 'null'
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'not released',
});