Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikutas committed Aug 2, 2024
1 parent 561b8a8 commit f53beba
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/released_or_not.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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',
});

0 comments on commit f53beba

Please sign in to comment.