forked from NAStool/nas-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (48 loc) · 1.43 KB
/
requirements.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
name: requirements
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- requirements.txt
- third_party.txt
jobs:
requirements-test:
runs-on: ubuntu-latest
steps:
- name: init Python 3.10.6
uses: actions/setup-python@v4
with:
python-version: '3.10.6'
- name: install dependent packages
run: |
git clone -b dev https://github.com/jxxghp/nas-tools.git --depth=1
cd nas-tools
hash_old=$(sha256sum requirements.txt)
pip install -r requirements.txt
pip install -r third_party.txt
pip uninstall -y -r third_party.txt
pip freeze > requirements.txt
hash_new=$(sha256sum requirements.txt)
if [ "$hash_old" == "$hash_new" ]; then
echo "hash_re="unchanged"" >> $GITHUB_ENV
else
echo "hash_re="changed"" >> $GITHUB_ENV
fi
echo ${{ env.hash_re }}
- if: ${{ env.hash_re == 'changed' }}
name: output requirements.txt if change
run: |
cd nas-tools
echo "---" > issue.md
echo "title: requirements changed on {{ date | date('dddd, MMMM Do') }}" >> issue.md
echo "---" >> issue.md
cat requirements.txt >> issue.md
cat issue.md
- if: ${{ env.hash_re == 'changed' }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: ./nas-tools/issue.md