-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
68 lines (60 loc) · 2.08 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: Update ShotGrid Readme
author: MaximumFX
description: Automatic README.md generator for ShotGrid frameworks/engines/apps and configurations.
branding:
icon: book-open
color: blue
inputs:
github_token:
required: true
description: GitHub secret token
infoFile:
required: false
description: The info.yml file
default: info.yml
prepend:
required: false
description: Filepath to an existing readme file to prepend after the name and description.
append:
required: false
description: Filepath to an existing readme file to append to the end.
mode:
required: false
description: "Which generator should be used: 'general' for frameworks/engines/apps, 'config' for configurations."
type: choice
options:
- general
- config
runs:
using: composite
steps:
- name: Checkout repo content
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Python packages
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r ${{ github.action_path }}/requirements.txt
- name: Execute py script with automatic mode
shell: bash
if: "${{ inputs.mode == '' }}"
run: python ${{ github.action_path }}/tk-readme-generator.py "${{ inputs.infoFile }}" -o -p "${{ inputs.prepend }}" -a "${{ inputs.append }}"
- name: Execute py script with mode
shell: bash
if: "${{ inputs.mode != '' }}"
run: python ${{ github.action_path }}/tk-readme-generator.py "${{ inputs.infoFile }}" -o -p "${{ inputs.prepend }}" -a "${{ inputs.append }}" -m ${{ inputs.mode }}
- name: Commit files
shell: bash
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git diff-index --quiet HEAD || (git commit -a -m "Update README.md" --allow-empty)
- name: push changes
uses: ad-m/[email protected]
with:
github_token: ${{ inputs.github_token }}
branch: ${{ github.ref }}