Skip to content

test

test #3

Workflow file for this run

name: PR Commenter (Secure App)
on: [pull_request]
# do not request perms for the standard token. it stays ro
permissions: {}
jobs:
comment:
runs-on: ubuntu-latest
steps:
# 1. create Token using the GitHub App
- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.COMMENTER_APP_ID }}
private-key: ${{ secrets.COMMENTER_APP_PRIVATE_KEY }}
# 2. use token to comment
- name: Post comment
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'my comment'
})