-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
68 lines (65 loc) · 2.23 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
name: 'Datetime of Workflow'
author: 'Zekeriya AY'
description: "Allows you show the datetime of workflow on your GitHub profile or project's README"
inputs:
github_token:
description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
required: true
date_format:
description: 'Allows you to change the format of the date or time displayed'
required: false
default: '%a %d %b %Y %H:%M:%S %Z'
timezone:
description: 'Timezone Region'
required: false
default: 'UTC'
tag:
description: 'The name of the tag to be updated in the Markdown'
required: false
default: 'DEFAULT-TAG'
markdown_path:
description: 'Path to Markdown file'
required: false
default: './README.md'
commit_branch:
description: 'Destination branch to push changes'
required: false
default: 'main'
commit_username:
description: 'Username of the user to commit. If nothing is written, the GitHub Bot is used'
required: false
default: 'github-actions[bot]'
commit_email:
description: 'Email of the user to commit. If nothing is written, the GitHub Bot is used'
required: false
default: 'github-actions[bot]@users.noreply.github.com'
commit_message:
description: 'Commit message'
required: false
default: '🚀 Datetime of Workflow Updated'
runs:
using: 'composite'
steps:
- name: 'Setup Python'
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: 'Install Dependencies'
run: |
python3 -m pip install -r https://raw.githubusercontent.com/ZekeriyaAY/workflow-datetime/main/requirements.txt
shell: bash
- name: 'Execute Python Script'
run: |
python3 $GITHUB_ACTION_PATH/script.py --format '${{ inputs.date_format }}' --tag ${{ inputs.tag }} --path ${{ inputs.markdown_path }} --timezone '${{ inputs.timezone }}'
shell: bash
- name: 'GitHub Commit & Push'
uses: actions-js/[email protected]
with:
github_token: ${{ inputs.github_token }}
author_name: ${{ inputs.commit_username }}
author_email: ${{ inputs.commit_email }}
branch: ${{ inputs.commit_branch }}
message: ${{ inputs.commit_message }}
branding:
icon: 'calendar'
color: 'yellow'