Skip to content

csv2registry #54

csv2registry

csv2registry #54

name: generate-ttl-and-commit
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install rdflib
pip install requests
pip install testtools
- name: Generate and commit ttl to PR branch
run: |
if [ git show-ref --quiet refs/heads/publication ];
then echo "publication branch exists"
git push origin --delete publication
fi
git checkout -b publication
python3 -m scripts.makeWCMP2Entities
git status
if [ -z "$(git status --porcelain)" ];
then echo 'nothing to commit'
else
git add --all
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git commit -am 'update wcmp2-codelists ttls'
git push --force --set-upstream origin publication
fi