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 Issue を作成する reusable workflow を作成する #73

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

masutaka
Copy link
Member

@masutaka masutaka commented Sep 12, 2024

変更概要

  • GitHub Issue を生成する reusable workflow を作成した
  • title, description_template_path, assignees, labels を入力可能

動作確認

備考

当初 5dc94d1JasonEtco/create-an-issue Action を使いましたが、よく考えたら gh CLI で十分だったので、 0b60a37 でリファクタリングしました。

JasonEtco/create-an-issue はテンプレート中で、環境変数や変数を使えることがメリットですが(下記参照)、一旦シンプルな実装にしました。

🔗 https://github.com/JasonEtco/create-an-issue/tree/56fdd2d6f960e970fa9d5ca3cf3884b6ba5af477?tab=readme-ov-file#usage

You'll notice that the above example has some {{ mustache }} variables. Your issue templates have access to several things about the event that triggered the action. Besides issue and pullRequest, you have access to all the template variables on this list. You can also use environment variables:

@masutaka masutaka self-assigned this Sep 12, 2024
@masutaka masutaka added the enhancement New feature or request label Sep 12, 2024
@masutaka masutaka force-pushed the create-issue-workflow branch from f546ea9 to 5dc94d1 Compare September 12, 2024 11:08
@masutaka masutaka changed the title GitHub Issue を生成する reusable workflow を作成 GitHub Issue を作成する reusable workflow を作成 Sep 12, 2024
@masutaka masutaka changed the title GitHub Issue を作成する reusable workflow を作成 GitHub Issue を作成する reusable workflow を作成する Sep 12, 2024
@masutaka masutaka force-pushed the create-issue-workflow branch from 2184fd8 to 0b60a37 Compare September 13, 2024 03:42
@masutaka masutaka marked this pull request as ready for review September 13, 2024 03:56
@masutaka masutaka requested a review from a team as a code owner September 13, 2024 03:56
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.

ありがとうございます!コメントしました!

# jobs:
# create_issue:
# uses: route06/actions/.github/workflows/create_gh_issue.yml@v2
# permissions:
Copy link
Member

Choose a reason for hiding this comment

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

後学の意図も含んだ質問なのですが、permissionsは外側で制御できたほうがよいのでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

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

内側で指定したかったんですが、内側のジョブで外側以上の permissions を設定するとエラーになってしまいました。

🔗 https://github.com/masutaka/sandbox/actions/runs/10829117246

The workflow is not valid. .github/workflows/create_issue.yml (Line: 15, Col: 3): Error calling workflow 'route06/actions/.github/workflows/create_gh_issue.yml@create-issue-workflow'. The nested job 'create_issue' is requesting 'issues: write', but is only allowed 'issues: none'.

Copy link
Member

Choose a reason for hiding this comment

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

ほぇ〜〜〜ありがとうございます!

@masutaka masutaka requested a review from TomckySan September 13, 2024 06:13
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.

ありがとござましたー!!!

@masutaka masutaka added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit 0b6ddca Sep 13, 2024
2 checks passed
@masutaka masutaka deleted the create-issue-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.

2 participants