GitHub Action for generating and checking freshness of data.json data dictionaries.
store-name- Name of the data store.store-type- Type of the data store.tool-type- Type of the data tool (e.g. migration).tool-path- Path to the data tool files (e.g. migration).proto-path- Path to services proto files.dictionary-app-id- Dictionary GitHub App ID.dictionary-app-private-key- Dictionary GitHub App private key.dictionary-repo- Dictionary repo name. Defaults todata-dictionary.dictionary-ref- Dictionary branch reference. Defaults tomaster.dictionary-workflow- Dictionary workflow name. Defaults tobuild.yml.repo-token- GitHub auth token for pull request comments (NOT for commits). Defaults to${{ github.token }}.
Below is an example recommended GitHub Actions workflow:
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- master
paths:
- "schema/**"
- "data.json"
jobs:
tag:
runs-on: ubuntu-latest
name: data-dictionary
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 2
- uses: mx51/data-dictionary-action@master
with:
store-name: my-store-name
store-type: postgres
tool-type: rubenv-sql-migrate
tool-path: schema
dictionary-app-id: ${{ secrets.DATA_DICTIONARY_APP_ID }}
dictionary-app-private-key: ${{ secrets.DATA_DICTIONARY_APP_PRIVATE_KEY }}For local development, ensure the following are installed:
- Docker
- Python 3.10+
The following environment variables are required to be set (e.g. .env file):
GITHUB_REPOSITORY- org/repo that you are testing against (see default environment variables)GITHUB_WORKSPACE- path to directory you are testing against (see default environment variables)STORE_NAME(seeinputs.store-name)STORE_TYPE(seeinputs.store-type)TOOL_TYPE(seeinputs.tool-type)TOOL_PATH(seeinputs.tool-path)
If you want to test Git actions (committing and pushing changes), set the following variables as well:
GITHUB_TOKEN(seeinputs.repo-token)GITHUB_PULL(seegithub.event.pull_request.number)
Once everything is set, execute the action script:
make run