Skip to content

Commit

Permalink
Merge pull request #15 from lowply/revert-0.2.1
Browse files Browse the repository at this point in the history
Revert 0.2.1
  • Loading branch information
lowply authored Oct 19, 2022
2 parents c72dcc4 + daa16b5 commit 0950a75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Issue From Template

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.
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.

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.
Note that if you use Go's template tags (`{{ .WeekNumber }}` etc) in the [YAML front matter](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/manually-creating-a-single-issue-template-for-your-repository) it won't be correctly parsed as GitHub's issue template.

## Environment variables

- `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.
- `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.
- `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
Expand Down
2 changes: 1 addition & 1 deletion src/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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", os.Getenv("IFT_TEMPLATE_NAME"))
i.template = filepath.Join(os.Getenv("GITHUB_WORKSPACE"), ".github", "ISSUE_TEMPLATE", os.Getenv("IFT_TEMPLATE_NAME"))
return i
}

Expand Down

0 comments on commit 0950a75

Please sign in to comment.