Skip to content

Import Data from Sirius #480

Import Data from Sirius

Import Data from Sirius #480

Workflow file for this run

name: Import Data from Sirius
on:
schedule:
- cron: '0 7 * * 1-5'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Pull Sirius Source data
env:
GITHUB_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
run: |
mkdir ./source-data
gh run download -n data-dictionary-json -R ministryofjustice/opg-sirius -D ./source-data
- name: Checkout
uses: actions/checkout@v3.2.0
with:
path: 'data-dictionary'
- name: Build
env:
GH_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
run: |
cd ./data-dictionary
branch=import-$(date +'%Y-%m-%d')
git branch $branch
git switch $branch
cp ../source-data/* ./src/_data/
echo "**Changed files pulled from Sirius data definitions:**" >> $GITHUB_STEP_SUMMARY
git status -s >> $GITHUB_STEP_SUMMARY
git config --global user.email "tools@digital.justice.gov.uk"
git config --global user.name "Github Action"
git add ./src/_data/
git commit -m "Import definitions from Sirius to Dictionary"
git push --set-upstream origin $branch
gh pr create --title "Data tables update" --body "Updating tables for data from Sirius tables"