Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinos Bairaktaris committed Jan 13, 2023
0 parents commit bc67c0a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
tags
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Github Action for Transifex CLI

> [Transifex CLI homepage](https://github.com/transifex/cli)
Integrate the Transifex CLI within a Github action. Usage:

1. Make sure your repository has a Transifex CLI configuration. If not, set it
up with:

```sh
tx init
tx add # Complete the interactive wizard
git add .tx
git commit -m "Add Transifex CLI configuration"
```

2. Add a Transifex API token to your repository as a repository secret

3. Use this in your Github action workflow:

```yaml
on: [push]
jobs:
Push-source-file:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Push source file using transifex client
uses: transifex/cli-action@v1
with:
token: ${{ secrets.TX_TOKEN }}
```
### Action options
**`token` (required)**: The Transifex API token to use for pushing

**`version` (default: latest)**: The Transifex CLI version to use

**`args` (default: push)**: Which arguments to pass to the tx command. By
default, the CLI will push the source files of all resources configured in
`.tx/config`.
30 changes: 30 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Transifex CLI action
description: Invoke the Transifex CLI as part of a Github action
branding:
icon: globe
color: blue
inputs:
version:
description: The version of the Transifex CLI to use
required: true
default: 'latest'
args:
description: What arguments to pass to the CLI
required: true
default: 'push'
token:
description: Transifex API token to use
required: true
runs:
using: 'composite'
steps:
- name: Create temporary directory to store the CLI
run: mkdir /tmp/tx
shell: bash
- name: Download the CLI
run: curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- ${{ inputs.version }}
working-directory: /tmp/tx
shell: bash
- name: Invoke the CLI with the provided token and arguments
run: /tmp/tx/tx --token ${{ inputs.token }} ${{ inputs.args }}
shell: bash

0 comments on commit bc67c0a

Please sign in to comment.