-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
34 lines (31 loc) · 1.43 KB
/
check-transmission-releases.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
name: Transmission Version Check
on:
schedule:
- cron: 0 * * * *
workflow_dispatch: {}
jobs:
get-transmission-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
ref: dev
- name: Check for new version of Transmission
run: |
LATEST_SHA=$(curl -L https://api.github.com/repos/transmission/transmission/tags | tac | tac | awk '/sha/ {print $2; exit}' | sed -e 's/[",]//g')
LATEST_VERSION=$(curl -L https://api.github.com/repos/transmission/transmission/releases/latest | awk '/tag_name/ {print $2}' | sed -e 's/[",]//g')
CURRENT_SHA=$(cat upstream/transmission-sha.txt)
if [ "$LATEST_SHA" != "$CURRENT_SHA" -a -n "$LATEST_SHA" -a -n "$LATEST_VERSION" ]; then
echo "$LATEST_SHA" > upstream/transmission-sha.txt
echo "$LATEST_VERSION" > upstream/transmission-version.txt
git config --global user.email "[email protected]"
git config --global user.name "workflow runner"
git add upstream/transmission-sha.txt
git add upstream/transmission-version.txt
git config user.email "[email protected]"
git config user.name "Transmission-Bot"
git commit -m "update transmission build version to ${LATEST_VERSION}"
git push origin dev
fi