forked from USRSE/usrse.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.72 KB
/
clean-expired-jobs.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
name: Remove Expired Jobs
on:
schedule:
# Run nightly 1am
- cron: 0 1 * * *
jobs:
clean-jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Remove Expired Jobs
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-pip python3-setuptools wget
sudo pip3 install requests pyaml urlchecker
# Ensure using a particular version
wget https://raw.githubusercontent.com/USRSE/usrse.github.io/8975717b2c00e72d4b368dfb3ad2b611875b0038/scripts/clean_jobs.py
chmod +x clean_jobs.py
mv clean_jobs.py scripts/clean_jobs.py
python3 scripts/clean_jobs.py
- name: Run URLs-checker
uses: urlstechie/urlchecker-action@0.2.1
with:
file_types: .md,.py,.yml
print_all: false
retry_count: 3
timeout: 10
white_listed_patterns: sc19.supercomputing.org,https://pace.gatech.edu,https://www.linkedin.com
white_listed_files: README.md,SocialNetworks.yml,map.yml,_config.yml,tests/test_,.github/workflows,_posts/newsletters/
- name: Push Fixes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git add _data/jobs.yml
set +e
git status | grep modified
if [ $? -eq 0 ]; then
set -e
printf "Changes\n"
git commit -m "Automated push to update jobs.yml $(date '+%Y-%m-%d')" || exit 0
git push origin master
else
set -e
printf "No changes\n"
fi