You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ditto-api-key | yes |[Generated Ditto API key](https://developer.dittowords.com/api-reference#creating-an-api-key)|
14
-
| ditto-dir | no |`ditto` directory location. Only required if the `ditto` directory is not located at the root of your repository. Must include 'ditto' (e.g. `./src/ditto`). |
15
-
| pr-title-prefix | no | String to prefix the pull request title with (e.g. "Web App Ditto Updates" would result in a PR titled: `Web App Ditto Updates YYYY-MM-DDT`) |
| ditto-api-key | yes |[Generated Ditto API key](https://developer.dittowords.com/api-reference#creating-an-api-key)|
14
+
| ditto-dir | no |`ditto` directory location. Only required if the `ditto` directory is not located at the root of your repository. Must include 'ditto' (e.g. `./src/ditto`). |
15
+
| pr-title-prefix | no | String to prefix the pull request title with (e.g. "Web App Ditto Updates" would result in a PR titled: `Web App Ditto Updates YYYY-MM-DDT`) |
16
+
| pull-from-legacy | no | By default, the action will pull from the latest version of Ditto. Set this to true to pull from legacy Ditto projects based on a legacy config file. |
16
17
17
18
## Example Workflow
18
19
@@ -24,7 +25,7 @@ jobs:
24
25
runs-on: ubuntu-latest
25
26
steps:
26
27
- name: Pull Ditto text and create a PR
27
-
uses: dittowords/ditto-github-action@v0.2.0
28
+
uses: dittowords/ditto-github-action@v1.0.0
28
29
with:
29
30
ditto-api-key: ${{ secrets.DITTO_API_KEY }}
30
31
```
@@ -39,20 +40,45 @@ jobs:
39
40
runs-on: ubuntu-latest
40
41
steps:
41
42
- name: Pull Ditto text for Web app and create a PR
42
-
uses: dittowords/ditto-github-action@v0.2.0
43
+
uses: dittowords/ditto-github-action@v1.0.0
43
44
with:
44
45
ditto-api-key: ${{ secrets.DITTO_API_KEY }}
45
46
ditto-dir: "./web/ditto"
46
47
pr-title-prefix: "Web Ditto text update"
47
48
48
49
- name: Pull Ditto text for iOS app and create a PR
49
-
uses: dittowords/ditto-github-action@v0.2.0
50
+
uses: dittowords/ditto-github-action@v1.0.0
50
51
with:
51
52
ditto-api-key: ${{ secrets.DITTO_API_KEY }}
52
53
ditto-dir: "./ios/ditto"
53
54
pr-title-prefix: "iOS App Ditto text update"
54
55
```
55
56
57
+
### If you have both new and legacy Ditto content in your application
This example workflow allows you to [manually start the workflow](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) resulting in the creation of a PR.
57
83
58
84
It is recommended to pass the `ditto-api-key` via a [GitHub secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to prevent your API key from getting exposed to the public.
Copy file name to clipboardExpand all lines: action.yml
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ inputs:
12
12
description: "String to prefix the pull request title with."
13
13
required: false
14
14
default: "Ditto text update"
15
+
pull-from-legacy:
16
+
description: "By default, will pull from the latest version of Ditto. Set this to true to pull from legacy Ditto projects based on a legacy config file."
17
+
required: false
18
+
default: false
15
19
runs:
16
20
using: "composite"
17
21
steps:
@@ -23,7 +27,7 @@ runs:
23
27
uses: actions/setup-node@v1
24
28
with:
25
29
node-version: 16
26
-
- run: npm install --global @dittowords/cli@4.5.2
30
+
- run: npm install --global @dittowords/cli^5.0.0
27
31
shell: bash
28
32
- uses: actions/checkout@v3
29
33
with:
@@ -33,7 +37,12 @@ runs:
33
37
DITTO_API_KEY: ${{ inputs.ditto-api-key }}
34
38
shell: bash
35
39
run: |
36
-
cd ${{ inputs.ditto-dir }}/.. && npx ditto-cli pull -m githubActionRequest:true
40
+
cd ${{ inputs.ditto-dir }}/..
41
+
if [ "${{ inputs.pull-from-legacy }}" = "true" ]; then
0 commit comments