-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
65 lines (59 loc) · 1.58 KB
/
action.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
---
name: Generate suggestion from docs bot
description: >
TODO
inputs:
in_msg:
description: TODO
required: true
github_token:
description: TODO
required: true
github_repository:
description: TODO
required: true
github_issue_number:
description: TODO
required: true
prefix_out_msg:
description: TODO
required: true
runs:
using: composite
steps:
- name: Check if action is allowed to be run
if: ${{ github.repository_owner != 'dobairoland' }}
shell: bash
run: |
echo "Using this action from outside the organization is not supported"
exit 1
- name: Checkout action repository
uses: actions/checkout@v4
with:
repository: espressif/docs-bot-action
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip
- name: Install Python dependencies
shell: bash
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
- name: Run bot_action.py
shell: bash
id: bot-action
run: |
source venv/bin/activate
echo "${{ inputs.in_msg }}" > input.txt
echo "${{ inputs.prefix_out_msg }}" > output.txt
echo -e "\n---\n" >> output.txt
python bot_action/bot_action.py input.txt >> output.txt || exit 1
- name: Comment
shell: bash
run: gh issue comment ${{ inputs.github_issue_number }} --body-file output.txt
env:
GH_TOKEN: ${{ inputs.github_token }}
GH_REPO: ${{ inputs.github_repository }}