Skip to content

dati.lombardia.it.dmfr.json: now licensed under CC-BY-4.0 #44

dati.lombardia.it.dmfr.json: now licensed under CC-BY-4.0

dati.lombardia.it.dmfr.json: now licensed under CC-BY-4.0 #44

Workflow file for this run

name: Apply opinionated DMFR format to PRs
on:
pull_request:
paths:
- '**.dmfr.json'
permissions:
contents: write
jobs:
format:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install transitland-lib
run: scripts/install-transitland-lib.sh
- name: Format in the opinionated DMFR format
run: |
find ./feeds -type f -name "*.dmfr.json" -exec transitland dmfr format --save {} \;
- name: "If any changes: commit and push"
run: |-
git config user.name "Automated Bot"
git config user.email "drew@interline.io"
if ! git_status_output="$(git status --porcelain)"; then
error_code="$?"
echo "'git status' had an error: $error_code"
exit 1
elif [ -z "$git_status_output" ]; then
echo "Working directory is clean."
else
echo "Working directory has UNCOMMITTED CHANGES."
git add -A
git commit -m "Apply opinionated DMFR format"
git push origin HEAD:${GITHUB_HEAD_REF}
fi
env:
GH_TOKEN: ${{ secrets.ATLAS_REPO_GH_PERSONAL_ACCESS_TOKEN }}