From 00128331237b5a774bb6c576a64521f7649fc397 Mon Sep 17 00:00:00 2001 From: Sho Mizutani Date: Wed, 19 Oct 2022 00:13:25 +0900 Subject: [PATCH] Use .github dir instead of .github/ISSUE_TEMPLATE dir --- README.md | 6 ++++-- src/issue.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 984b8d5..657f3c8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Issue From Template -This action opens a new issue from an issue template. It parses the template's front matter and the body, then posts [an API request to open an issue](https://docs.github.com/en/rest/issues/issues#create-an-issue). Works best with a [scheduled workflow](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) and the [Auto Closer](https://github.com/lowply/auto-closer) action. +This action opens a new issue from a markdown template file. It parses the template's front matter and the body, then posts [an API request to open an issue](https://docs.github.com/en/rest/issues/issues#create-an-issue). Works best with a [scheduled workflow](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) and the [Auto Closer](https://github.com/lowply/auto-closer) action. + +Note that "template" here is just a markdown file, not [GitHub's issue template feature](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates) which uses yaml file. ## Environment variables -- `IFT_TEMPLATE_NAME` (*required*): The name of the issue template. For example, `report.md`. This action will look for the file in the `.github/ISSUE_TEMPLATE` directory. +- `IFT_TEMPLATE_NAME` (*required*): The name of the issue template. For example, `report.md`. This action will look for the template file in the `.github` directory. **Note that it will not look for any sub directories** including the `.github/ISSUE_TEMPLATE` directory. - `ADD_DATES` (*optional*): Number of the dates to add. This is useful when you want to run this action to open an issue for the next week, not this week. ## Available template variables diff --git a/src/issue.go b/src/issue.go index 4912b69..196f707 100644 --- a/src/issue.go +++ b/src/issue.go @@ -35,7 +35,7 @@ func NewIssue() *issue { i.data = NewData(time.Now().AddDate(0, 0, dates)) } i.endpoint = "https://api.github.com/repos/" + os.Getenv("GITHUB_REPOSITORY") + "/issues" - i.template = filepath.Join(os.Getenv("GITHUB_WORKSPACE"), ".github", "ISSUE_TEMPLATE", os.Getenv("IFT_TEMPLATE_NAME")) + i.template = filepath.Join(os.Getenv("GITHUB_WORKSPACE"), ".github", os.Getenv("IFT_TEMPLATE_NAME")) return i }