-
Notifications
You must be signed in to change notification settings - Fork 3
/
action.yml
77 lines (75 loc) · 2.65 KB
/
action.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Random Workflows Cron
description: 'Generate a random cron expression based on the current time and specified number of intervals.'
author: 'grbnb'
branding:
icon: upload-cloud
color: green
inputs:
workflow_name:
description: 'Workflow_filename path to be modified'
required: true
default: ${{ github.workflow_ref }} # e.g. grbnb/random-workflow-cron/.github/workflow/cron.yml@refs/heads/main
push_switch:
description: 'The modified workflow_file push or not at once'
required: false
default: true
github_token:
description: 'GitHub api token [PAT] The key must have repo and workflow permissions'
required: true
default: ${{ github.token }}
repository:
description: 'The owner and repository name'
required: false
default: ${{ github.repository }} # e.g. grbnb/random-workflow-cron
ref_branch:
description: 'The modified workflow_file push to destination branch'
required: false
default: ${{ github.ref_name }} # e.g. main
keep_history:
description: 'Keep the workflow_file history commit message.'
required: false
default: false
author:
description: 'The author name and email address to push commit.'
required: false
default: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
time_zone:
description: "The time zone of the user's region, with a range of UTC±12 (default UTC+0)."
required: false
hour_start:
description: 'Define the intervals start hour (default 0).'
required: false
hour_end:
description: 'Define the intervals end hour (default 23).'
required: false
interval_count:
description: 'Number of intervals to divide the day into (default 2).'
required: false
cron_dmw:
description: 'Custom cron DayofMonth Month DayofWeek (default "* * *").'
required: false
runs:
using: 'composite'
steps:
- if: ${{ inputs.push_switch == 'true' }}
uses: actions/checkout@v4
with:
token: ${{ inputs.github_token }}
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref_branch }}
fetch-depth: 2
- shell: bash
run: bash "${{ github.action_path }}/cron.sh"
env:
workflow_name: ${{ inputs.workflow_name }}
push_switch: ${{ inputs.push_switch }}
github_token: ${{ inputs.github_token }}
repository: ${{ inputs.repository }}
ref_branch: ${{ inputs.ref_branch }}
keep_history: ${{ inputs.keep_history }}
author: ${{ inputs.author }}
time_zone: ${{ inputs.time_zone }}
hour_start: ${{ inputs.hour_start }}
hour_end: ${{ inputs.hour_end }}
interval_count: ${{ inputs.interval_count }}
cron_dmw: ${{ inputs.cron_dmw }}