Skip to content

Update SharedResource.en.resx (#88) #8

Update SharedResource.en.resx (#88)

Update SharedResource.en.resx (#88) #8

Workflow file for this run

# 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" ]
paths:
- '**.resx' # XML-based (resource) translation file format, .NET
workflow_dispatch:
# GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 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: ${{ secrets.AZURE_TRANSLATOR_SUBSCRIPTION_KEY }}
# The Azure Cognitive Services translator resource endpoint.
endpoint: ${{ secrets.AZURE_TRANSLATOR_ENDPOINT }}
# (Optional) The Azure Cognitive Services translator resource region.
# This is optional when using a global translator resource.
region: 'eastus'
# (Optional) Locales to translate to, otherwise all possible locales
# are targeted. Requires double quotes.
toLocales: '["bg","es","fi","fr","de","it","nl","pt","sv","sw"]'
- 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 }}'