-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konstantinos Bairaktaris
committed
Jan 13, 2023
0 parents
commit bc67c0a
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |