marocchino-sticky-pull-requ.../action.yml
Copilot ae583cebed
Some checks failed
Test / test (push) Has been cancelled
feat: embed file content in message template via {path} placeholder (#1665)
* Initial plan

* Add prefix and suffix inputs to wrap comment body

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* feat: support combining path and message inputs using $path placeholder

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* feat: use {path} placeholder and remove prefix/suffix inputs

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* feat: rename placeholder from {path} to {{{content}}}

Agent-Logs-Url: https://github.com/marocchino/sticky-pull-request-comment/sessions/72744cd4-264e-4c06-95d4-6fdec3446f90

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* fix: when message has no {{{content}}} placeholder, return message as-is

Agent-Logs-Url: https://github.com/marocchino/sticky-pull-request-comment/sessions/b6492aa3-c55c-41f7-b43e-12cc3f2c3002

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* refactor: simplify {{{content}}} replacement — drop includes guard and regex

Agent-Logs-Url: https://github.com/marocchino/sticky-pull-request-comment/sessions/81112a7b-0e6d-4f21-ad36-530af7c0259f

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

* chore: remove accidentally committed dist/src/* and add to .gitignore

Agent-Logs-Url: https://github.com/marocchino/sticky-pull-request-comment/sessions/7ced80dd-92a9-46ad-b667-bf5ceaa129ea

Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>
2026-04-24 21:37:42 +09:00

95 lines
4.3 KiB
YAML

name: "Sticky Pull Request Comment"
description: "Create comment on pull request, if exists update that comment."
author: "marocchino"
github-token:
action-input:
input: GITHUB_TOKEN
is-default: true
permissions:
pull-requests: write
pull-requests-reason: to create or update PR comment
inputs:
header:
description: "Header to determine if the comment is to be updated, not shown on screen. It can be used when you want to add multiple comments independently at the same time."
default: ""
required: false
append:
description: "Indicate if new comment messages should be appended to previous comment message. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
recreate:
description: "Indicate if previous comment should be removed before creating a new comment. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
delete:
description: "delete the previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
only_create:
description: "only create a new comment if there is no existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it. This options has higher priority than hide_and_recreate, hide."
default: "false"
required: false
only_update:
description: "only update a exist comment if there is existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
hide_details:
description: "hide summary tags in the previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
hide:
description: "hide previously created comment. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
hide_and_recreate:
description: "Indicate if previous comment should be hide before creating a new comment. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
hide_classify:
description: "The reasons a piece of content can be reported or minimized. SPAM, ABUSE, OFF_TOPIC, OUTDATED, DUPLICATE, RESOLVED."
default: "OUTDATED"
required: false
message:
description: "comment message. When used together with path, use `{{{content}}}` as a placeholder in the message where the file content should be inserted."
required: false
path:
description: "glob path to file(s) containing comment message. When message is also provided and contains `{{{content}}}`, the file content is embedded at that placeholder position."
required: false
ignore_empty:
description: "Indicates whether to ignore missing or empty messages"
default: "false"
required: false
skip_unchanged:
description: "only update or recreate if message is different from previous. Only `true` is allowed. Just skip this item when you don't need it."
default: "false"
required: false
follow_symbolic_links:
description: "Indicates whether to follow symbolic links for path"
default: "false"
required: false
number:
description: "pull request number for push event"
required: false
number_force:
description: "pull request number for any event"
required: false
owner:
description: "Another repo owner, If not set, the current repo owner is used by default. Note that when you trying changing a repo, be aware that GITHUB_TOKEN should also have permission for that repository."
required: false
repo:
description: "Another repo name limited use on github enterprise. If not set, the current repo is used by default. Note that When you trying changing a repo, be aware that GITHUB_TOKEN should also use that repo's."
required: false
GITHUB_TOKEN:
description: "The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to create or update the comment. This defaults to {{ github.token }}."
default: "${{ github.token }}"
required: false
outputs:
previous_comment_id:
description: "ID of previous comment, if found"
created_comment_id:
description: "ID of newly created comment, if any"
runs:
using: "node24"
main: "dist/index.js"