File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 4
4
issues :
5
5
types : [labeled]
6
6
7
+ permissions :
8
+ contents : write
9
+
7
10
jobs :
8
11
issue_to_markdown :
9
12
if : contains(github.event.label.name, 'locked')
15
18
- name : Convert Issue to Markdown
16
19
id : convert
17
20
env :
18
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21
+ GITHUB_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
19
22
run : |
20
23
issue_number=${{ github.event.issue.number }}
21
24
curl -s -H "Authorization: token $GITHUB_TOKEN" \
@@ -25,12 +28,18 @@ jobs:
25
28
echo "# ${{ github.event.issue.title }}" > issues/issue-$issue_number.md
26
29
echo "\n\n${{ github.event.issue.body }}" >> issues/issue-$issue_number.md
27
30
echo "\n## Comments" >> issues/issue-$issue_number.md
28
- jq -r '.[] | "\n### \(.user.login) commented:\n \(.body)"' comments.json >> issues/issue-$issue_number.md
31
+ cat comments.json
32
+ if jq -e . >/dev/null 2>&1 < comments.json; then
33
+ jq -r '.[] | "\n### \(.user.login) commented:\n \(.body)"' comments.json >> issues/issue-$issue_number.md
34
+ mv comments.json issues/issue-$issue_number-comments.json
35
+ else
36
+ echo "\nNo comments available." >> issues/issue-$issue_number.md
37
+ fi
29
38
- name : Commit Markdown
30
39
run : |
31
40
git config --global user.name 'github-actions'
32
41
git config --global user.email 'github-actions@github.com'
33
- git checkout -b feat/capture-issues
42
+ git checkout feat/capture-issues
34
43
git add issues/
35
44
git commit -m "Convert locked issue ${{ github.event.issue.number }} to markdown"
36
45
git push origin feat/capture-issues
You can’t perform that action at this time.
0 commit comments