Skip to content

gndelia/onesky-uploader-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

OneSky File uploader

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.

Inputs

projectId

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.

publicKey

Required The public key from your OneSky account. Find out how to retrieve your OneSky API key

privateKey

Required The private key from your OneSky account. Find out how to retrieve your OneSky API key

filepath

Required The path to the folder where your translation file is. Starts from the root folder of your project. Do not include the filename.

filename

Required The translation filename (extension included). This will be combined with the filepath to retrieve the file

locale

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.

fileFormat

The input format from your translation file. Check out the list of available file formats here. Defaults to IOS_STRINGS

isKeepingAllStrings

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

isAllowTranslationSameAsOriginal

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.

Outputs

None

Example usage

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