-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathaction.yml
35 lines (33 loc) · 928 Bytes
/
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
name: Get ParaTranz Project ID
description: Get ParaTranz Project ID
inputs:
target_lang:
description: "Target language to run"
required: true
outputs:
project_id:
description: "Project ID of ParaTranz"
value: ${{ steps.load-project-id.outputs.project_id }}
runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 2
- name: Setup jq
shell: bash
run: sudo apt-get install jq
- name: Load project ID from JSON
id: load-project-id
shell: bash
run: |
project_id=$(jq -r --arg lang "$target_lang" '.[$lang]' paratranz-projects.json)
if [ "$project_id" == "null" ]; then
echo "Unknown language: $target_lang"
exit 1
fi
echo "project_id=${project_id}" >> $GITHUB_OUTPUT
env:
target_lang: ${{ inputs.target_lang }}