-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.36 KB
/
redbot-args-update.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
name: Update redbot-arguments.txt
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Python version
id: build_info
run:
pyver=$(cat Dockerfile | grep FROM | grep -oP '(\d(\.\d\d?)?)')
echo "python_version=$pyver" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v5
with:
python-version: ${{ steps.build_info.outputs.python_version }}
- name: Install dependencies
run: pip install -r redbot/requirements.txt
- name: Update redbot-arguments.txt
run: |
: > "$ARGS_FILE"
redbot --version >> "$ARGS_FILE"
echo >> "$ARGS_FILE"
redbot --help >> "$ARGS_FILE"
if git status | grep -q 'Changes not staged for commit' ; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add "$ARGS_FILE"
git commit -m "Update ${ARGS_FILE##*/}"
git push
echo "${ARGS_FILE##*/} has been updated." >> $GITHUB_STEP_SUMMARY
else
echo "${ARGS_FILE##*/} did not need to be updated." >> $GITHUB_STEP_SUMMARY
fi
env:
ARGS_FILE: .github/redbot-arguments.txt