-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
143 lines (138 loc) · 4.47 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: "README Build"
author: "nclsbayona"
description: "Update your README file with some data acquired via some APIs and information about you"
inputs:
python-version:
required: false
description: 'Python version to use to run the file'
default: '3.10'
type: string
drink-format:
required: false
default: 'html'
description: 'The format to output drink instructions (string|html|json|csv)'
type: choice
options:
- 'string'
- 'html'
- 'json'
- 'csv'
wakatime-format:
required: false
default: 'html'
description: 'The format to output wakatime information (string|html|json|csv)'
type: choice
options:
- 'string'
- 'html'
- 'json'
- 'csv'
wakatime-api-key:
required: false
default: ''
type: string
description: 'Wakatime API Key to display information about time on PC. Not adding a value to this input disables the lookup of info on Wakatime servers'
nasa-api-key:
required: false
type: string
default: ''
description: 'Nasa API Key to display a photo of the universe. Not adding a value to this input disables the lookup of info on Nasa servers'
file-path:
type: string
required: false
default: 'README.md'
description: 'File path of the file we want to generate'
template-file-path:
type: string
required: false
default: 'render_templates/main_template_file'
description: 'File path of the template we use to generate the file'
github-username:
type: string
required: true
description: 'Github username of the user running the action'
telegram-username:
type: string
required: false
default: ''
description: 'Telegram username of the user running the action'
twitter-username:
type: string
required: false
default: ''
description: 'Twitter username of the user running the action'
linkedin-username:
type: string
required: false
default: ''
description: 'LinkedIn username of the user running the action'
webpage-url:
type: string
required: false
default: ''
description: 'The url to the user webpage'
webpage-qr:
type: string
required: false
default: ''
description: 'A QR to the user webpage'
contributions-url:
required: true
type: string
description: 'URL to an image of user contributions'
remove-old-readme:
required: false
description: 'Whether or not this action should delete the old README'
default: true
type: boolean
# github-token:
# required: true
# description: 'GitHub Token with permissions to push the new README to the repository'
# outputs:
# status:
# description: 'The status of the action run'
runs:
using: "composite"
steps:
- name: Download necessary files and folder
continue-on-error: false
shell: bash
run: |
wget https://raw.githubusercontent.com/nclsbayona/nclsbayona-readme-action/master/main.py
wget https://raw.githubusercontent.com/nclsbayona/nclsbayona-readme-action/master/requirements.txt
git clone https://github.com/nclsbayona/nclsbayona-readme-action.git && mv nclsbayona-readme-action/render_templates . && rm -rf nclsbayona-readme-action
- if: ${{ inputs.remove-old-readme }}
name: Remove old README
run: rm -rf README.md
shell: bash
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
- name: Install dependencies
shell: bash
run: pip install -r requirements.txt
- name: Generate file
shell: bash
run: python main.py
env:
WAKATIME_API_KEY: ${{ inputs.wakatime-api-key }}
NASA_API_KEY: ${{ inputs.nasa-api-key }}
GITHUB_USERNAME: ${{ inputs.github-username }}
TELEGRAM_USERNAME: ${{ inputs.telegram-username }}
TWITTER_USERNAME: ${{ inputs.twitter-username }}
LINKEDIN_USERNAME: ${{ inputs.linkedin-username }}
FILE_PATH: ${{ inputs.file-path }}
TEMPLATE_FILE_PATH: ${{ inputs.template-file-path }}
DRINK_FORMAT: ${{ inputs.drink-format }}
WAKATIME_FORMAT: ${{ inputs.wakatime-format }}
WEBPAGE_URL: ${{ inputs.webpage-url }}
WEBPAGE_QR: ${{ inputs.webpage-qr }}
CONTRIBUTIONS_URL: ${{ inputs.contributions-url }}
- name: Delete files and folder
shell: bash
run: rm -rf main.py render_templates requirements.txt
branding:
icon: user-check
color: blue