-
Notifications
You must be signed in to change notification settings - Fork 3
30 lines (30 loc) · 1.39 KB
/
versions.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
#from https://stackoverflow.com/questions/58465057/trigger-a-github-action-when-another-repository-creates-a-new-release
name: Upstream Versions CI
on:
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
- name: Fetch release version
id: vars
run: |
curl -sL https://api.github.com/repos/caddyserver/caddy/releases/latest | jq -r ".tag_name" > versions/caddy.txt
curl -sL https://api.github.com/repos/keeweb/keeweb/releases/latest | jq -r ".tag_name" > versions/keeweb.txt
echo "caddy_version=$(cat versions/caddy.txt)" >> "$GITHUB_OUTPUT"
echo "keeweb_version=$(cat versions/keeweb.txt)" >> "$GITHUB_OUTPUT"
- name: Check for modified files
id: git-check
run: echo "modified=$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")" >> "$GITHUB_OUTPUT"
- name: Commit latest release version
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Slurdge'
git config --global user.email '[email protected]'
git commit -am "Caddy: ${{ steps.vars.outputs.caddy_version }} - Keeweb: ${{ steps.vars.outputs.keeweb_version }}"
git push