Skip to content

comment on issue

comment on issue #18

name: "Comment on New Issue"

Check failure on line 1 in .github/workflows/comment-on-issue.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/comment-on-issue.yml

Invalid workflow file

(Line: 23, Col: 14): Unexpected value '', (Line: 24, Col: 9): Unexpected value 'script'
on:
issues:
types: [opened, labeled]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number"
required: true
type: number
permissions:
issues: write
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v8
with:
script: |
// Use workflow_dispatch input if present, otherwise fall back to issue event
const issue_number = context.payload.inputs?.issue_number
? parseInt(context.payload.inputs.issue_number, 10)
: context.issue.number;
await github.issues.createComment({
...context.repo,
issue_number,
body: "👋 Thank you for opening this issue! We will look into it as soon as possible."
});