-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
47 lines (42 loc) · 1.35 KB
/
action.yml
File metadata and controls
47 lines (42 loc) · 1.35 KB
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
name: 'Python __version__ Badge'
description: 'Python __version__ Badge'
inputs:
github-token:
description: 'GITHUB_TOKEN secret'
required: true
package-dir:
description: 'Directory containing __version__.py file'
required: true
file-name:
description: 'Name of the SVG badge file to write'
required: true
badge-branch:
description: 'Branch to store SVG badges on (uses your default branch if not supplied)'
required: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Checkout the target repo
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Checkout the action repo
uses: actions/checkout@v3
with:
repository: action-badges/python-dunder-version-badge
ref: main
path: 9pHpeQMXhE # random string, unlikely to generate a collision
- run: pip install packaging
shell: bash
- run: "source <(python 9pHpeQMXhE/version_badge.py ${{ inputs.package-dir }})"
shell: bash
- name: Write Badge
uses: action-badges/core@main
with:
file-name: "${{ inputs.file-name }}"
github-token: "${{ inputs.github-token }}"
badge-branch: "${{ inputs.badge-branch }}"
label: "${{ env.LABEL }}"
message: "${{ env.MESSAGE }}"
message-color: "${{ env.MESSAGE-COLOR }}"