-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (45 loc) · 1.73 KB
/
take-the-survey.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Process survey's entry
on:
issues:
types: [ opened ]
concurrency: 'main'
jobs:
take_survey:
runs-on: ubuntu-latest
if: contains(github.event.issue.title, 'DO NOT EDIT') && contains(github.event.issue.title, 'takes the developer survey')
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GA_WORKFLOW_DEPLOYMENTS_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: elhmn/github-issue-parser@release-parse-checkbox
id: issue-parser
with:
template-path: .github/ISSUE_TEMPLATE/take-the-survey.yaml
- run: echo '${{ steps.issue-parser.outputs.jsonString }}' > survey_submission.json
- run: |
cat survey_submission.json | jq
- name: Set convert json to yaml
shell: bash
run: |
cat survey_submission.json | yq e '{"items": [.]}' -P - > survey_submission.yaml
- run: cat survey_submission.yaml
- run: cat ./src/res/survey.yaml
- name: Set convert json to yaml
shell: bash
run: |
yq ea '. as $item ireduce ({}; . *+ $item)' -i ./src/res/survey.yaml survey_submission.yaml
- run: cat ./src/res/survey.yaml
- name: Commit changes
shell: bash
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com" && \
git config --global user.name "github-actions[bot]" && \
git add ./src/res/survey.yaml && \
git commit -m 'new survey answer' && \
git push
- uses: peter-evans/close-issue@v1
with:
comment: Your survey answer was submitted and will be deployed in few minutes here https://devsurvey.osscameroon.com.