-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
69 lines (59 loc) · 1.98 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
name: i18n-check-action
description: A GitHub action to check i18n/L10n keys and values
author: Andrew Tavis McAllister <[email protected]>
inputs:
src-dir:
description: 'The directory that has source code to check'
required: true
default: 'src'
i18n-dir:
description: 'The directory path to the i18n files'
required: true
default: 'i18n'
i18n-src:
description: 'The source file for the i18n process'
required: true
default: 'en-US.json'
token:
description: 'The GitHub token to use for downloading the action (defaults to workflow token)'
required: true
default: ${{ github.token }}
outputs:
error:
description: 'The description of any error that occurred'
value: ${{ steps.run.outputs.error }}
runs:
using: 'composite'
steps:
- name: Set reusable variables
shell: bash
run: |
echo "action_repo=i18n-check-action" >> $GITHUB_ENV
echo "action_org=activist-org" >> $GITHUB_ENV
echo "binary_name=i18n-check-action" >> $GITHUB_ENV
- name: Add binary extension
shell: bash
if: runner.os == 'Windows'
run: echo "binary_name=${{ env.binary_name }}.exe" >> $GITHUB_ENV
- name: Get Action Version
id: get_action_version
shell: pwsh
run: |
$finalComponent = Split-Path -Leaf ${{ github.action_path }}
if ($finalComponent -eq "${{ env.action_repo }}") {
$version = ""
} else {
$version = $finalComponent
}
Write-Output "version=$version" >> $Env:GITHUB_OUTPUT
- name: Download Action
shell: bash
run: |
gh release download ${{ steps.get_action_version.outputs.version }} --repo ${{ env.action_org }}/${{ env.action_repo }} --pattern '${{ runner.os }}.tgz'
tar -xzf ${{ runner.os }}.tgz
env:
GITHUB_TOKEN: ${{ inputs.token }}
- name: Run Action
shell: bash
id: run
run: ./${{ runner.os }}/${{ env.binary_name }} "${{ inputs.error }}"