This GitHub action allows you to upload a resource file to OneSky for its translation. you can execute this action whenever your resource file change, or periodically.
Required Id from the project to which upload the resource file. It's the number listed after a #
in the project list from your dashboard.
Required The public key from your OneSky account. Find out how to retrieve your OneSky API key
Required The private key from your OneSky account. Find out how to retrieve your OneSky API key
Required The path to the folder where your translation file is. Starts from the root folder of your project. Do not include the filename.
Required The translation filename (extension included). This will be combined with the filepath
to retrieve the file
Required Locale code for your resource file. It should match the list provided by OneSky. If not provided, it will default to the base language.
The input format from your translation file. Check out the list of available file formats here. Defaults to IOS_STRINGS
If true, it will keep those strings that cannot be found in the uploaded file and existed before. If false, they will be deprecated. Defaults to true
This setting applies to translation upload, skip importing translations that are the same as source text if set to false. Keeping the translations that are the same as source text if set to true.
None
Previously checkout your repository with
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'
Then use this action with the following example
- name: real upload
uses: gndelia/onesky-uploader-action@v0.0.1
with:
projectId: ${{ secrets.ONESKY_PROJECT_ID }} # projectId from OneSky stored in GH secrets
publicKey: ${{ secrets.ONESKY_PUBLIC_KEY }} # publicKey from OneSky stored in GH secrets
privateKey: ${{ secrets.ONESKY_PRIVATE_KEY }} # privateKey from OneSky stored in GH secrets
filepath: path/to/folder/where/the/file/is # Do not include the filename here
filename: my-file.json # filename
locale: en-US
fileformat: HIERARCHICAL_JSON
isKeepingAllStrings: false
You can trigger this action in your workflow as you like: For instance, periodically:
# This workflow is triggered once a week
name: My once a week workflow
on:
schedule:
- cron: '0 10 * * 1'
jobs:
# Below the steps execution as the example above
or everytime your resource file changes
# This workflow is triggered once a week
name: My workflow that fires everytime the resource file changes
on:
push:
branches:
- main
paths:
- path/to/my/resources.json
jobs:
# Below the steps execution as the example above