Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ditto GitHub Action

Actions
Automatically updates Ditto text in a repository that has ditto-cli initiated
v1.0.2
Latest
Star (5)

ditto-github-action

The Ditto github action creates a PR with the most recent Ditto text updates.

Prerequisites

To include the Ditto GitHub action as a part of your repo's workflow, the repo must have integration with the Ditto CLI. If your repository does not have a ditto directory with a filled-out config.yml as a result of initializing the Ditto CLI this action will not work.

Inputs

Name Required Description
ditto-api-key yes Generated Ditto API key
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).
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)
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.

Example Workflow

name: Update Ditto Text
on: workflow_dispatch
jobs:
  UpdateDittoText:
    runs-on: ubuntu-latest
    steps:
      - name: Pull Ditto text and create a PR
        uses: dittowords/[email protected]
        with:
          ditto-api-key: ${{ secrets.DITTO_API_KEY }}

With Multiple Ditto Config files

name: Update Ditto Text
on: workflow_dispatch
jobs:
  UpdateWebDittoText:
    runs-on: ubuntu-latest
    steps:
      - name: Pull Ditto text for Web app and create a PR
        uses: dittowords/[email protected]
        with:
          ditto-api-key: ${{ secrets.DITTO_API_KEY }}
          ditto-dir: "./web/ditto"
          pr-title-prefix: "Web Ditto text update"

      - name: Pull Ditto text for iOS app and create a PR
        uses: dittowords/[email protected]
        with:
          ditto-api-key: ${{ secrets.DITTO_API_KEY }}
          ditto-dir: "./ios/ditto"
          pr-title-prefix: "iOS App Ditto text update"

If you have both new and legacy Ditto content in your application

name: Update Ditto Text
on: workflow_dispatch
jobs:
  UpdateWebDittoText:
    runs-on: ubuntu-latest
    steps:
      - name: Pull Ditto text and create a PR
        uses: dittowords/[email protected]
        with:
          ditto-api-key: ${{ secrets.DITTO_API_KEY }}
          ditto-dir: "./new/ditto"
          pr-title-prefix: "New Ditto text update"

      - name: Pull legacy Ditto text and create a PR
        uses: dittowords/[email protected]
        with:
          ditto-api-key: ${{ secrets.DITTO_API_KEY }}
          ditto-dir: "./legacy/ditto"
          pr-title-prefix: "Legacy Ditto text update"
          pull-from-legacy: "true"

This example workflow allows you to manually start the workflow resulting in the creation of a PR.

It is recommended to pass the ditto-api-key via a GitHub secret to prevent your API key from getting exposed to the public.

Ditto GitHub Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Automatically updates Ditto text in a repository that has ditto-cli initiated
v1.0.2
Latest

Ditto GitHub Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.