-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (44 loc) · 1.34 KB
/
compile-requirements.yml
File metadata and controls
50 lines (44 loc) · 1.34 KB
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
name: Compile Requirements
on:
push:
branches: [main]
paths:
- "*/info.json"
- ".github/compile_cog_requirements.py"
pull_request:
branches: [main]
paths:
- "*/info.json"
- ".github/compile_cog_requirements.py"
workflow_dispatch:
jobs:
compile-requirements:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref || github.ref }}
- name: Set up Python
uses: actions/setup-python@v6
- name: Compile requirements
run: python3 .github/compile_cog_requirements.py
- name: Check for changes
id: check_changes
run: |
if git diff --quiet requirements.txt; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add requirements.txt
git commit -m "chore: update cog requirements.txt"
git push