Skip to content

Keep alive

Keep alive #590

Workflow file for this run

# Keep the GitHub Actions alive. If there is no activity for 60 days, GitHub Actions gets
# disabled. So we add a commit every so often.
name: Keep alive
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *"
workflow_run:
workflows: [Deploy]
types: [completed]
env:
PRODUCTION_URL: https://nugettools.azurewebsites.net
jobs:
keep-alive:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Write current versions
shell: pwsh
run: |
$month = (Get-Date).ToUniversalTime().ToString('MMMM yyyy', [CultureInfo]::InvariantCulture)
$versions = curl $env:PRODUCTION_URL/api/versions
$data = $versions | jq --arg month "$month" ". | {month: `$month, versions: .}"
$data | Out-File latest-versions.json -Encoding utf8
- name: Commit and push if data has changed
run: |
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
git commit -m "Update latest-versions.json" || exit 0
git push