-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.5 KB
/
flag-dependencies.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Flag Stale Dependencies
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
inputs:
force_email:
description: Force sending an email
required: false
default: false
concurrency:
group: dependency-flagger
cancel-in-progress: true
jobs:
flag-stale-deps:
name: Flagger
runs-on: ubuntu-20.04
env:
PYTHON_VERSION: '3.10'
LASTVERSION_VERSION: '2.4.5'
POETRY_VERSION: '1.1.13'
YQ_VERSION: '2.14.0'
steps:
-
name: Checkout repo
uses: actions/checkout@v3
-
name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
-
name: Check versions
env:
GITHUB_API_TOKEN: ${{ github.token }}
run: |
sudo pip install "lastversion==${LASTVERSION_VERSION}" "poetry==${POETRY_VERSION}" "yq==${YQ_VERSION}"
echo '# Misc Dependencies' >> dependencies.txt
./scripts/check-versions.sh github-action | awk '{print " * " $0}' | tee -a dependencies.txt
echo >> dependencies.txt
echo '# Frontend' >> dependencies.txt
cd frontend
npm install
npm outdated | grep -v '^Package *Current *Wanted *Latest' | awk '{print " * " $0}' | tee -a ../dependencies.txt
cd ..
echo >> dependencies.txt
echo '# Backend' >> dependencies.txt
cd backend
poetry env use "python${PYTHON_VERSION}"
poetry show -o | awk '{print " * " $0}' | tee -a ../dependencies.txt
cd ..
echo 'Done!'
-
name: Cache versions
uses: actions/cache@v3
id: versions-have-changed
with:
path: dependencies.txt
key: versions-${{ hashFiles('dependencies.txt') }}
-
name: Send mail
uses: dawidd6/action-send-mail@v3
if: steps.versions-have-changed.outputs.cache-hit != 'true' || (github.event_name == 'workflow_dispatch' && github.event.inputs.force_email)
with:
server_address: ${{ secrets.MAIL_SERVER_ADDRESS }}
server_port: ${{ secrets.MAIL_SERVER_PORT }}
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
to: ${{ secrets.MAIL_TO_ADDRESS }}
from: ${{ secrets.MAIL_FROM }}
subject: jewpizza Dependencies Changed!
body: file://dependencies.txt
html_body: file://dependencies.txt
convert_markdown : true