-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
56 lines (47 loc) · 1.48 KB
/
action.yaml
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
name: Markdown Accessibility
description: Suggests alt text for images in markdown files
branding:
icon: image
color: purple
inputs:
azure_key:
description: "Azure Computer Vision API key"
required: false
azure_endpoint:
description: "Azure Computer Vision API endpoint"
required: false
language:
description: "Language to use for alt text suggestions"
required: false
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v2
- name: Check Alt Text
id: alt_text_checker
run: |
python ${{ github.action_path }}/alt_text_checker.py ${{ github.workspace }}
shell: bash
- name: Install dependencies
if: steps.alt_text_checker.outputs.result == 'true'
run: |
pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- name: Suggest Alt Text
if: steps.alt_text_checker.outputs.result == 'true'
run: |
python ${{ github.action_path }}/alt_text.py ${{ github.workspace }} ${{inputs.azure_key}} ${{inputs.azure_endpoint}} ${{inputs.language}}
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Suggest alt text for images"
git push
shell: bash
- uses: DavidAnson/markdownlint-cli2-action@v10
continue-on-error: true
with:
command: fix
globs: "**/*.md"