Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
51 lines (47 loc) · 1.75 KB
/
Copy pathaction.yml
File metadata and controls
51 lines (47 loc) · 1.75 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
48
49
50
51
name: 'Composer Translation Validator'
description: 'Validate translation files (XLIFF, YAML, JSON, PHP) using the composer-translation-validator PHAR'
author: 'move-elevator'
branding:
icon: 'check-circle'
color: 'blue'
inputs:
version:
description: 'Release tag to use (e.g. "1.6.0"). Defaults to the latest release.'
required: false
default: 'latest'
args:
description: 'Whitespace-separated arguments passed to the PHAR, e.g. paths and options.'
required: false
default: '.'
working-directory:
description: 'Directory the PHAR is executed in.'
required: false
default: '.'
runs:
using: 'composite'
steps:
- name: Download PHAR
shell: bash
env:
VERSION: ${{ inputs.version }}
run: |
if [ "$VERSION" = "latest" ]; then
base_url="https://github.com/move-elevator/composer-translation-validator/releases/latest/download"
else
base_url="https://github.com/move-elevator/composer-translation-validator/releases/download/${VERSION}"
fi
curl -fsSL -o "$RUNNER_TEMP/composer-translation-validator.phar" "${base_url}/composer-translation-validator.phar"
curl -fsSL -o "$RUNNER_TEMP/composer-translation-validator.phar.sha256" "${base_url}/composer-translation-validator.phar.sha256"
- name: Verify checksum
shell: bash
working-directory: ${{ runner.temp }}
run: sha256sum -c composer-translation-validator.phar.sha256
- name: Run validator
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
ARGS: ${{ inputs.args }}
run: |
set -f
chmod +x "$RUNNER_TEMP/composer-translation-validator.phar"
php "$RUNNER_TEMP/composer-translation-validator.phar" $ARGS