-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
113 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: Test source | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/test-source.yml | ||
- dist/** | ||
- src/** | ||
- action.yml | ||
push: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
shell: sh | ||
|
||
jobs: | ||
test-source: | ||
name: Source as ${{ matrix.source }} | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
env: | ||
TEXT: "Love" | ||
EXPECTED: "Любов" | ||
strategy: | ||
matrix: | ||
source: ["file", "text"] | ||
steps: | ||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v4 | ||
- name: Prepare source | ||
id: params | ||
run: | | ||
if [ "${{ matrix.source }}" = "file" ]; then | ||
source="source.txt" | ||
echo "${TEXT}" > "${source}" | ||
else | ||
source="${TEXT}" | ||
fi | ||
echo "source=${source}" >> "$GITHUB_OUTPUT" | ||
- name: Translate | ||
uses: ./ | ||
id: translate | ||
with: | ||
provider: "deepl" | ||
lang: "en-uk" | ||
source: "${{ steps.params.outputs.source }}" | ||
api_key: "${{ secrets.DEEPL_API_KEY }}" | ||
- name: Validate translated text | ||
run: | | ||
echo "'${TEXT}' has been translated to '${{ steps.translate.outputs.text }}'" | ||
[ "${{ steps.translate.outputs.text }}" = "${EXPECTED}" ] || exit 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
--- | ||
name: 'Translation Action' | ||
name: "Translation Action" | ||
author: Yevhen Fabizhevskyi | ||
description: 'This action translates any text to any language supported by chosen provider.' | ||
description: "This action translates any text to any language supported by chosen provider." | ||
branding: | ||
icon: users | ||
color: green | ||
inputs: | ||
source: | ||
description: 'Text or path to the file for translation.' | ||
description: | | ||
Text or path to the file (absolute or relative to $GITHUB_WORKSPACE) for | ||
translation. | ||
required: true | ||
provider: | ||
description: 'Provider identifier.' | ||
description: "Provider identifier." | ||
required: true | ||
api_key: | ||
description: 'API key that should be used for chosen provider.' | ||
description: "API key that should be used for chosen provider." | ||
required: false | ||
default: '' | ||
default: "" | ||
api_additional_parameter: | ||
description: 'Additional parameter for the API. eg the region for Microsoft: canadacentral.' | ||
description: | | ||
Additional parameter for the API. eg the region for Microsoft: canadacentral. | ||
required: false | ||
default: '' | ||
default: "" | ||
lang: | ||
description: 'The translation direction. Should be one of the option proposed by chosen provider.' | ||
description: | | ||
The translation direction. Should be one of the option proposed by chosen | ||
provider. | ||
required: true | ||
outputs: | ||
text: | ||
description: 'Translated text.' | ||
description: "Translated text." | ||
runs: | ||
using: 'node20' | ||
main: 'dist/index.js' | ||
using: "node20" | ||
main: "dist/index.js" |
Oops, something went wrong.