-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.54 KB
/
cron.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Cron
env:
GH_TOKEN: ${{ secrets.PAT }}
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "30 21 * * 1-5"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
npx auto version
- run: |
if [ "$(npx auto version)" = "patch" ];
then
echo "::error::It is a patch version"
exit 1
fi
- run: |
if [ "$(npx auto version)" = "major" ];
then
echo "::error::It is a major version"
exit 1
fi
- if: ${{ github.event.schedule && github.event.inputs.mode != 'force-version' && github.event.inputs.version != '' }}
run: |
echo "::error::Please choose version mode when forcing a version number"
exit 1
- if: ${{ github.event.schedule && github.event.inputs.mode == 'force-version' && github.event.inputs.version == '' }}
run: |
echo "::error::Please enter a version number when forcing a specific publish version"
exit 1
build:
name: Node v${{ matrix.node }}
needs: check-version
runs-on: ubuntu-latest
strategy:
matrix:
node: [20]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0