You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privateconststring_errorMessage="An error occurred trying to execute the command to parse a GitHub issue forms. See inner exception for more details.";
5
+
privateconststring_errorMessage="An error occurred trying to execute the command to parse a GitHub issue form. See inner exception for more details.";
Copy file name to clipboardExpand all lines: GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormTemplates/Parsing/IssueFormYamlTemplateParser.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ public static IssueFormYamlTemplate Parse(IssueFormYamlTemplateText yamlTemplate
Copy file name to clipboardExpand all lines: GitHubIssueFormsParser/src/GitHubIssuesParserCli/IssueFormTemplates/Parsing/IssueFormYamlTemplateParserException.cs
conststringmessage="Failed to deserialize the issue forms template. The template must contain at least an YAML member named 'body' at the first indentation level.";
12
+
conststringmessage="Failed to deserialize the issue form template. The template must contain at least an YAML member named 'body' at the first indentation level.";
Copy file name to clipboardExpand all lines: GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/CliCommands/ParseIssueFormCommandValidationTests.cs
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ public async Task ValidateIssueFormBodyParam(string? issueFormBody)
exception.InnerException.Message.ShouldStartWith("Failed to deserialize the issue forms template. The template must contain at least an YAML member named 'body' at the first indentation level.");
85
+
exception.InnerException.Message.ShouldStartWith("Failed to deserialize the issue form template. The template must contain at least an YAML member named 'body' at the first indentation level.");
86
86
}
87
87
88
88
/// <summary>
@@ -99,10 +99,10 @@ public async Task InvalidIssueFormBody()
exception.InnerException.Message.ShouldStartWith("Failed to obtain the value for H3 header: '### What NuGet package do you want to release?'. Couldn't find any text between that H3 header and the next H3 header: '### What is the new version for the NuGet package?'.");
@@ -139,7 +139,7 @@ public async Task InvalidIssueFormBody3()
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,25 +38,25 @@ A Docker container [GitHub action](https://docs.github.com/en/actions/learn-gith
38
38
39
39
| Name | Description
40
40
| --- | --- |
41
-
| `template-filepath` | The filepath to the [issue forms template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms). |
41
+
| `template-filepath` | The filepath to the [issue form template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms). |
42
42
| `issue-form-body` | The body of the issue to parse. |
43
43
44
44
### Action outputs
45
45
46
46
| Name | Description
47
47
| --- | --- |
48
-
| `parsed-issue` | The issue forms parsed as a JSON string. |
48
+
| `parsed-issue` | The issue form parsed as a JSON string. |
49
49
50
50
**Notes about the JSON output:**
51
51
52
52
- The keys on the JSON object are id field of the template form element.
53
53
- Checkboxes form elements are outputed as an object whose keys are the [slugified]((https://blog.tersmitten.nl/slugify/)) value of the label of the option.
54
-
- When the form element is optional and no input is provided for the form element then the issue forms body will contain a `_No response_` but the parsed output for that key in the JSON string will just be an empty value.
54
+
- When the form element is optional and no input is provided for the form element then the issue form body will contain a `_No response_` but the parsed output for that key in the JSON string will just be an empty value.
55
55
- **For a better understanding of the output rules see example below.**
56
56
57
-
## Example output for a given issue forms template and body
57
+
## Example output for a given issue form template and body
58
58
59
-
Given the following issue forms template:
59
+
Given the following issue form template:
60
60
61
61
```yml
62
62
name: Release NuGet package
@@ -120,7 +120,7 @@ body:
120
120
- label: Linux
121
121
```
122
122
123
-
And given the following issue forms body:
123
+
And given the following issue form body:
124
124
125
125
```md
126
126
### What NuGet package do you want to release?
@@ -180,7 +180,7 @@ The output would be:
180
180
181
181
You can check the structure of the action's output on the log produced by the action.
182
182
183
-
In the log for the action, expand the groups for `dotnet GitHub issue forms parser output` and `dotnet GitHub issue forms parser output indented` as shown in the image below.
183
+
In the log for the action, expand the groups for `dotnet GitHub issue form parser output` and `dotnet GitHub issue form parser output indented` as shown in the image below.
Copy file name to clipboardExpand all lines: docs/dev-notes/README.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,16 +32,16 @@ The steps below show how to run the Docker container action against a set of tes
32
32
33
33
1) Clone the repo and browse to the repo's directory.
34
34
2) Run `docker build -t github-issue-parser .`
35
-
3) Read the test issue forms body into the variable `$issueBody` by doing: `$issueBody = Get-Content GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/TestFiles/IssueBody.md -Raw`
35
+
3) Read the test issue form body into the variable `$issueBody` by doing: `$issueBody = Get-Content GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/TestFiles/IssueBody.md -Raw`
36
36
4) Run the docker container by executing `docker run --rm -v ${pwd}:/workspace --workdir /workspace github-issue-parser GitHubIssueFormsParser/tests/GitHubIssuesParserCli.Tests/TestFiles/Template.yml $issueBody`.
37
37
38
38
**Notes:**
39
39
40
40
- The docker container entrypoint expects two arguments:
41
-
1) First, the filepath to the issue forms template.
42
-
2) Second, the issue forms body.
43
-
- When running the docker container the current directory is mounted to the docker container so that we can read the issue forms template.
44
-
- When reading the issue forms body into the `$issueBody` variable we have to use the `-Raw` parameter to avoid problems with line endings.
41
+
1) First, the filepath to the issue form template.
42
+
2) Second, the issue form body.
43
+
- When running the docker container the current directory is mounted to the docker container so that we can read the issue form template.
44
+
- When reading the issue form body into the `$issueBody` variable we have to use the `-Raw` parameter to avoid problems with line endings.
45
45
46
46
## Projects wide configuration
47
47
@@ -73,7 +73,9 @@ This action is published to the [GitHub marketplace](https://github.com/marketpl
73
73
74
74
## Note about the Docker container action
75
75
76
-
This repo provides a [Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action). See here for more information about the [syntax for a Docker container action](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-docker-container-actions). To understand better how the action builds and executes the Docker container look at the log for the steps that build and run the action.
76
+
This repo provides a [Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action). If parsing the GitHub issue form fails then the action [will fail](https://docs.github.com/en/enterprise-cloud@latest/actions/creating-actions/setting-exit-codes-for-actions#setting-a-failure-exit-code-in-a-docker-container-action). See here for more information about the [syntax for a Docker container action](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-docker-container-actions).
77
+
78
+
To understand better how the action builds and executes the Docker container look at the log for the steps that build and run the action.
77
79
78
80
### As of writing this, the log for building the docker action looks as follows
79
81
@@ -130,19 +132,19 @@ This allows the GitHub action to access the files checked out by the workflow an
130
132
131
133
**Example:**
132
134
133
-
- Repository `hello-world` has an issue forms template file at `.github\ISSUE_TEMPLATE\my-template.yml`.
135
+
- Repository `hello-world` has an issue form template file at `.github\ISSUE_TEMPLATE\my-template.yml`.
134
136
- We create a workflow in the `hello-world` repository that checks out the `hello-world` repo and makes use of the `GitHub issue forms parser` action.
135
137
- We set the `template-filepath` input parameter of the `GitHub issue forms parser` action to `.github\ISSUE_TEMPLATE\my-template.yml`.
136
138
- When the workflow is executing the Docker container is able to get to `.github\ISSUE_TEMPLATE\my-template.yml` because the contents of the checked out `hello-world` repo are mounted into the Docker container at `/github/workspace`. Furthermore the `template-filepath` input parameter doesn't need to start with `/github/workspace` because the `workdir` parameter is set to `/github/workspace` when executing the Docker container.
137
139
138
140
## Other notes
139
141
140
-
When creatng the [Test GitHub action workflow](/.github/workflows/test-action.yml) I had difficulty figuring out how to properly read the issue forms body from a file and pass it into the GitHub action as an input parameter.
142
+
When creatng the [Test GitHub action workflow](/.github/workflows/test-action.yml) I had difficulty figuring out how to properly read the issue form body from a file and pass it into the GitHub action as an input parameter.
141
143
142
-
What was happening initially was that the newlines were not being preserved and the action would fail to parse the issue forms body. To help me debug this issue and see exactly what text, including newline characters, were being passed into the action I added the following debug step:
144
+
What was happening initially was that the newlines were not being preserved and the action would fail to parse the issue form body. To help me debug this issue and see exactly what text, including newline characters, were being passed into the action I added the following debug step:
143
145
144
146
```yml
145
-
- name: Debug reading issue forms body file using -Raw
147
+
- name: Debug reading issue form body file using -Raw
- Contains a step that executes the GitHub action provided by this repo.
8
-
- Runs the action against a test template and a test issue forms body.
8
+
- Runs the action against a test template and a test issue form body.
9
9
- Checks that the output produced by the action is as expected.
10
10
11
11
Since this workflow executes the [Docker container action](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action) it will build and execute the docker container so if there are any issues with the action's [Dockerfile](/Dockerfile) this workflow will detect it.
0 commit comments