-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (38 loc) · 1.22 KB
/
chron.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
name: "Tag Release"
on:
schedule:
- cron: "0 8 28 * *"
workflow_dispatch:
inputs:
vers:
description: 'Semantic Version Number'
required: false
jobs:
tag_release:
runs-on: ubuntu-latest
name: Create Revision
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
- name: Read release information
run: |
if [ -z ${{ github.event.inputs.vers }} ]
then
VERS=$(curl -s https://api.github.com/repos/dita-ot/dita-ot/releases/latest | jq -r '.tag_name')
else
VERS=${{ github.event.inputs.vers }}
fi
sed -E 's/([0-9]{1,}.){1,}([0-9]){1,}/'"${VERS}"'/g' Dockerfile > Dockerfile.tmp && mv Dockerfile.tmp Dockerfile
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add -A .
git commit -m 'Bump Docker image version to '"${VERS}"'' -a || true
git tag "${VERS}" -a -m 'Release '"${VERS}"'' || true
- name: Push changes
uses: ad-m/github-push-action@master
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}