Remove Expired Jobs #1141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove Expired Jobs | |
on: | |
schedule: | |
# Run nightly 1am | |
- cron: 0 1 * * * | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git Hash (Optional) | |
required: false | |
jobs: | |
clean-jobs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install required packages | |
run: | | |
pip install requests pyaml urlchecker | |
- name: Remove Expired Jobs | |
run: | | |
python scripts/clean_jobs.py | |
- name: Run URLs-checker | |
uses: urlstechie/[email protected] | |
with: | |
# A comma-separated list of file types to cover in the URL checks | |
file_types: .md,.py,.yml | |
# Choose whether to include file with no URLs in the prints. | |
print_all: false | |
# More verbose summary at the end of a run | |
verbose: true | |
# How many times to retry a failed request (defaults to 1) | |
retry_count: 3 | |
# Google Forms is having enormous timeouts | |
timeout: 10 | |
# Exclude these patterns from the checker | |
exclude_patterns: supercomputing.org,https://pace.gatech.edu,https://www.linkedin.com,jobs.colorado.edu,zoom.us,danielskatz.org,usrse.github.io.wiki.git,ornl.gov,jobs.bnl.gov,https://www.rd-alliance.org/,https://uwhires.admin.washington.edu/,https://careers.umich.edu/,https://twitter.com/us_rse,https://twitter.com/us_rse/status/1447622175133945860,https://twitter.com/iancosden/status/1122937311644323841 | |
# Only include these files | |
include_files: _data/jobs.yml,_data/related-jobs.yml,_data/internships.yml | |
- 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 "[email protected]" | |
git add _data/jobs.yml _data/related-jobs.yml _data/internships.yml | |
set +e | |
git status | grep modified | |
if [ $? -eq 0 ]; then | |
set -e | |
printf "Changes\n" | |
git commit -m "Automated push to update jobs files $(date '+%Y-%m-%d')" || exit 0 | |
git push origin main | |
else | |
set -e | |
printf "No changes\n" | |
fi |