-
Notifications
You must be signed in to change notification settings - Fork 15
144 lines (129 loc) · 5.24 KB
/
generate-user-stories.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: publish 'in productie' en 'in ontwikkeling' user stories
on:
schedule:
- cron: '0 9,11,12,14,16,17 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create User Stories IO
run: |
echo -e '---\nlayout: page-with-side-nav\ntitle: User Stories in Ontwikkeling\n---\n' >> user-stories-dev.md
echo -e '# User stories\n' >> user-stories-dev.md
- name: List 'v2.1' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v2.1" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
cat issues-tmp.md >> user-stories-dev.md
echo -e '\n' >> user-stories-dev.md
- name: Create User Stories Prod
run: |
echo -e '---\nlayout: page-with-side-nav\ntitle: User Stories in Productie\n---\n' >> user-stories-prod.md
echo -e '# User stories\n' >> user-stories-prod.md
- name: List 'v2.0' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v2.0" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 2.0\n' >> user-stories-prod.md
echo -e 'In versie 2.0 zijn geen user stories geïmplementeerd.\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.5' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.5" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.5\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.4' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.4" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.4\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.3' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.3" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.3\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.2' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.2" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.2\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.1' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.1" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.1\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: List 'v1.0' user stories
uses: lee-dohm/select-matching-issues@v1.2.0
with:
format: list
query: label:"v1.0" label:"User Story"
token: ${{ secrets.GITHUB_TOKEN }}
path: issues-tmp.md
- run: |
echo -e '## Vanaf versie 1.0\n' >> user-stories-prod.md
cat issues-tmp.md >> user-stories-prod.md
echo -e '\n' >> user-stories-prod.md
- name: target=_blank toevoegen aan issue link
run: |
sed -i 's/)$/){:target="_blank" rel="noopener"}/' user-stories-dev.md
sed -i 's/)$/){:target="_blank" rel="noopener"}/' user-stories-prod.md
- name: move user-stories markdown bestanden naar ./docs
run: |
mv user-stories-dev.md ./docs/user-stories-dev.md
mv user-stories-prod.md ./docs/user-stories-prod.md
- name: commit & push user-stories markdown bestanden
run: |
if [ -n "$(git status ./docs/user-stories-dev.md --porcelain)" ]; then
git add ./docs/user-stories-dev.md
fi
if [ -n "$(git status ./docs/user-stories-prod.md --porcelain)" ]; then
git add ./docs/user-stories-prod.md
fi
if [ -n "$(git status ./docs --porcelain)" ]; then
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git commit -m "commit user stories artifacts"
git pull --ff
git push
fi