-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guillaume Falourd <[email protected]>
- Loading branch information
1 parent
adf02da
commit 710262a
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Test" | ||
description: Test | ||
title: "Test" | ||
labels: ["test1","test2"] | ||
assignees: | ||
- ${{github.author}} | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Formulário padrão | ||
- type: input | ||
id: name | ||
attributes: | ||
label: ">>Name<<" | ||
description: Name | ||
placeholder: myname | ||
validations: | ||
required: true | ||
|
||
- type: dropdown | ||
id: template | ||
attributes: | ||
label: ">>Template<<" | ||
description: Select an option | ||
options: | ||
- option1 | ||
- option2 | ||
- option3 | ||
|
||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Issue Form | ||
|
||
on: | ||
issues: | ||
types: [opened, reopened] | ||
|
||
jobs: | ||
comment: | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.issue.labels.*.name, 'urbancode') && !contains(github.event.issue.labels.*.name, 'stackspot') }} | ||
steps: | ||
- name: Create comment | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body: | | ||
Follow the run through: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
reactions: '+1' | ||
|
||
form-to-json: | ||
name: Convert Form Issue to JSON | ||
runs-on: ubuntu-latest | ||
needs: [comment] | ||
outputs: | ||
payload-parsed: ${{ steps.payload.outputs.json_var }} | ||
steps: | ||
- name: Run Issue form parser | ||
id: parse | ||
uses: peter-murray/[email protected] | ||
with: | ||
issue_id: ${{ github.event.issue.number }} | ||
separator: '###' | ||
label_marker_start: '>>' | ||
label_marker_end: '<<' | ||
|
||
- name: Set output | ||
id: payload | ||
run: echo ::set-output name=json_var::'${{ steps.parse.outputs.payload }}' | ||
|
||
- name: Show output | ||
run: echo "${{ toJson(steps.payload.outputs.json_var) }}" | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: [form-to-json] | ||
steps: | ||
- name: Test echo form fields | ||
run: | | ||
echo ${{ fromJson(needs.form-to-json.outputs.payload-parsed)['Name'] }} | ||
echo ${{ fromJson(needs.form-to-json.outputs.payload-parsed)['Template'] }} | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
|
||
auto-closing-issue: | ||
needs: [test] | ||
name: Auto-closing Issue | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Close Issue | ||
id: parse | ||
uses: peter-evans/close-issue@v1 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
comment: Close automatically through https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |