Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

指定した GitHub Discussion ID に固定コメントを追加する reusable workflow を作成 #72

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

masutaka
Copy link
Member

@masutaka masutaka commented Sep 11, 2024

変更概要

  • 指定した GitHub Discussion ID にコメントを追加する reusable workflow を追加した
  • コメントは comment_template_path で、ファイルパスを指定する
  • 追加したコメントに返信することも可能

動作確認

補足

@TomckySan と話して、下記 PR を私の方でやろうとしました。

ただ、テンプレートファイルで変数を使うのは、初期実装として大きかったので一旦固定コメントにしました。

コメントを何個も追加するユースケースは、matrix 使って add_discussion_comment.yml を何回も実行したほうが良いかも知れません。

@masutaka masutaka added the enhancement New feature or request label Sep 11, 2024
@masutaka masutaka self-assigned this Sep 11, 2024
@masutaka masutaka marked this pull request as ready for review September 11, 2024 10:45
@masutaka masutaka requested a review from a team as a code owner September 11, 2024 10:45
@masutaka masutaka force-pushed the add-discussion-comment-workflow branch from 0e997f7 to 8f4dc4b Compare September 12, 2024 00:57
@masutaka masutaka force-pushed the add-discussion-comment-workflow branch from 8f4dc4b to fc808c6 Compare September 12, 2024 00:58
@masutaka masutaka changed the title 指定した GitHub Discussion ID に固定コメントを追加する reusable workflow を追加 指定した GitHub Discussion ID に固定コメントを追加する reusable workflow を作成 Sep 12, 2024
Copy link
Member

@TomckySan TomckySan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとございます!方針異論ないっす!!! 🙌🏻

Copy link
Contributor

@MH4GF MH4GF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

方針良さそうに見えました! 👍🏻

Comment on lines 97 to 99
console.log('DISCUSSION_ID: %s', DISCUSSION_ID);
console.log('COMMENT_TEMPLATE_PATH: %s', COMMENT_TEMPLATE_PATH);
console.log('REPLY_TO_COMMENT_ID: %s', REPLY_TO_COMMENT_ID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この辺りは消し忘れでしょうか?


nits: ログ出力を意図する場合、coreモジュールの core.info() などを使う方が適切そうでした。
https://github.com/actions/toolkit/tree/main/packages/core#logging

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おっと! 消し忘れです! 16646f9 で削除しました。

DISCUSSION_ID: ${{ inputs.discussion_id }}
COMMENT_TEMPLATE_PATH: ${{ inputs.comment_template_path }}
REPLY_TO_COMMENT_ID: ${{ inputs.reply_to_comment_id }}
uses: actions/github-script@v7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 GitHub製のアクションはv7指定で問題ない

@masutaka
Copy link
Member Author

ありがとうございました!

@masutaka masutaka added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit c287447 Sep 13, 2024
2 checks passed
@masutaka masutaka deleted the add-discussion-comment-workflow branch September 13, 2024 06:17
@route06-actions-ci route06-actions-ci bot mentioned this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants