-
Notifications
You must be signed in to change notification settings - Fork 18
38 lines (32 loc) · 1.1 KB
/
keep-alive.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
# 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