Reformat files #3
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 is a basic workflow to help you get started with Actions | |
name: Create translation pull request | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the main branch | |
on: | |
push: | |
branches: [ main, test ] | |
paths: | |
- '**.json' # JSON-based, key value pair file format | |
# GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow. | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AZURE_TRANSLATOR_SUBSCRIPTION_KEY: ${{ secrets.AZURE_TRANSLATOR_SUBSCRIPTION_KEY }} | |
AZURE_TRANSLATOR_ENDPOINT: ${{ secrets.AZURE_TRANSLATOR_ENDPOINT }} | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Use the machine-translator to automatically translate resource files | |
- name: Machine Translator | |
id: translator | |
uses: IEvangelist/[email protected] | |
with: | |
# The source locale (for example, 'en') used to create the glob pattern | |
# for which resource (**/*.en.resx) files to use as input | |
sourceLocale: 'en' | |
# The Azure Cognitive Services translator resource subscription key | |
subscriptionKey: $AZURE_TRANSLATOR_SUBSCRIPTION_KEY | |
# The Azure Cognitive Services translator resource endpoint. | |
endpoint: $AZURE_TRANSLATOR_ENDPOINT | |
# (Optional) The Azure Cognitive Services translator resource region. | |
# This is optional when using a global translator resource. | |
# region: ${{ secrets.AZURE_TRANSLATOR_REGION }} | |
# (Optional) Locales to translate to, otherwise all possible locales | |
# are targeted. Requires double quotes. | |
toLocales: '["es","fr","de"]' | |
- name: create-pull-request | |
uses: peter-evans/[email protected] | |
if: ${{ steps.translator.outputs.has-new-translations }} == 'true' | |
with: | |
title: '${{ steps.translator.outputs.summary-title }}' | |
commit-message: '${{ steps.translator.outputs.summary-details }}' |