Skip to content

Instantly share code, notes, and snippets.

@danielgomezrico
Created July 15, 2022 19:57
Show Gist options
  • Save danielgomezrico/651ad02e616334aaf0ae0e0fe3abdd17 to your computer and use it in GitHub Desktop.
Save danielgomezrico/651ad02e616334aaf0ae0e0fe3abdd17 to your computer and use it in GitHub Desktop.
Github Action - Comment on PR using the PR number
name: PR Commenter
on:
pull_request:
types: [opened, reopened]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
let message = "\nsomething-${{github.event.number}}
github.issues.createComment({ issue_number, owner, repo, body: message });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment