Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (60 sloc) 2.6 KB

Gettext updates

This action automates the manual steps needed to regenerate the gettext templates if required

Requirements

This image is intended for use with elementary debian projects. There are a few requirements before getting started:

  1. The project needs to have a deb-packaging branch with the necessary debian packaging for the project. Docs: debian control
  2. The project needs to use the meson build system

Environment Variables

In order to create tags and push changes to various branches, the script needs a GitHub token. When using GitHub workflows, the virtual environment automatically comes with a generated GitHub token secret. However, if your translation branch is protected, you will need to use a Personal Access Token with the repo scope, generated by a user who has admin permissions for the repo. To do so:

  1. Generate a Personal Access Token from your GitHub user settings
  2. Give it the repo scope
  3. Copy the generated Personal Access Token
  4. In the repo's settings, navigate to the "Secrets" tab and "Add a new secret"
  5. Name the new secret GIT_USER_TOKEN and paste the copied Personal Access Token

Git User

Instead of using the default GitHub token (GITHUB_TOKEN), you can use a custom Personal Access Token with the GIT_USER_TOKEN environment variable. You can also use the following environment variables to set the git user and email:

env:
  GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}"
  GIT_USER_NAME: "example-user"
  GIT_USER_EMAIL: "exampleuser@example.com"

Specifying a translation branch name

By default, this action will use a branch named 'master' to to push the changes. The branch name can be set via the translation_branch input. Example:

with:
  translation_branch: 'i18n'

Examples

Simple Example

name: Gettext updates
on:
  push:
    branches: master
jobs:
  gettext_template:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: elementary/actions/gettext-template@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full Example

name: Gettext updates
on:
  push:
    branches: master
jobs:
  gettext_template:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: elementary/actions/gettext-template@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        translation_branch: 'i18n'
You can’t perform that action at this time.