-
Notifications
You must be signed in to change notification settings - Fork 8
29 lines (27 loc) · 1.06 KB
/
check.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
name: Check Latest OpenVPN Version
on:
schedule:
- cron: '0 6,18 * * *'
workflow_dispatch:
jobs:
version_check:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
- name: Get the latest version of OpenVPN
run: |
OPENVPN_VERSION_TAG=$(curl -fsSL https://api.github.com/repos/openvpn/openvpn/git/refs/tags|jq -r .[].ref|cut -d"/" -f3|grep -E -ve "alpha|beta|branch|rc|RC"|sort -V|tail -n1|sed "s/v//g")
if ! [ -z "${OPENVPN_VERSION_TAG}" ]; then
if curl -fsSL http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/ | grep "openvpn-${OPENVPN_VERSION_TAG}"; then
echo "${OPENVPN_VERSION_TAG}" > version
echo "{\"version\":\"${OPENVPN_VERSION_TAG}\"}" > manifest.json
echo "OPENVPN_VERSION=$(cat version)" >> $GITHUB_ENV
fi
fi
- name: Add & Commit
uses: EndBug/[email protected]
with:
message: 'Version updated to: ${{ env.OPENVPN_VERSION }}'