-
-
Notifications
You must be signed in to change notification settings - Fork 80
70 lines (60 loc) · 2.03 KB
/
issue_comment.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
name: "🤖 Réponse automatique à un ticket de proposition de contenu"
on:
issues:
types:
- reopened
- opened
jobs:
rdp_form:
name: "📰 Proposition de news"
runs-on: ubuntu-latest
if: contains( github.event.issue.labels.*.name, 'rdp')
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: 3.11
- name: Parse template form
uses: stefanbuck/github-issue-parser@v3
id: issue-parser
with:
issue-body: ${{ github.event.issue.body }} # required
template-path: .github/ISSUE_TEMPLATE/RDP_NEWS.yml
# see: https://github.com/stefanbuck/github-issue-parser/issues/38
- name: Export into JSON file using env var
run: echo $JSON_STRING > rdp_news_submitted.json
env:
JSON_STRING: ${{ steps.issue-parser.outputs.jsonString }}
- name: Save form output as artifact
uses: actions/upload-artifact@v4
with:
name: input_form.json
path: "rdp*.json"
retention-days: 15
- name: Install Python dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel
python -m pip install -U "jinja2<4"
- name: Fill comment template with form
env:
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
ISSUE_ID: ${{ github.event.issue.number }}
run: python scripts/issue_comment_templater_rdp.py
- name: Save comment artifact
uses: actions/upload-artifact@v4
with:
name: output_comment.md
overwrite: true
path: "rdp*_output.md"
retention-days: 15
- name: Create comment from file
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body-file: 'rdp_news_submitted_comment_output.md'