-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (38 loc) · 980 Bytes
/
daily-tag.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
39
40
41
42
43
44
45
name: Daily tag
on:
# Run this daily at 13:17 GMT+0, a little after 9AM EST.
schedule:
- cron: '17 13 * * *'
workflow_dispatch:
inputs:
tag:
description: 'Enter version to use as tag'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.COMMIT_KEY }}
- name: Get tag
id: tag
env:
INPUT: ${{ github.event.inputs.tag }}
run: |
if [ -n "$INPUT" ]; then
echo "::set-output name=tag::$(echo $INPUT)"
else
# input is empty - daily trigger, so use date
echo "::set-output name=tag::$(date +'%Y-%m-%d')"
fi
- name: Tag commit
env:
TAG: ${{ steps.tag.outputs.tag }}
run: |
git tag ${TAG}
- name: Push tag
run: |
git push --tags