Skip to content

Merge pull request #384 from dthaler/propagate #2

Merge pull request #384 from dthaler/propagate

Merge pull request #384 from dthaler/propagate #2

# This action will create generated files, and is done whenever the main branch is updated.
#
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Build
on:
push:
branches: [ main, next-minor ]
permissions:
contents: read
jobs:
generate-files:
permissions:
contents: write # for Git to git push
pull-requests: write # for Git to create a pull request
runs-on: ubuntu-latest
env:
SPECDIR: ../specification/
EXTDIR: ../extracted-files/
steps:
- uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
disable-sudo: true
egress-policy: audit
- name: Checkout GEDCOM
uses: actions/checkout@v4
- name: Get the branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Generate grammar.abnf and grammar.gedstruct
working-directory: ${{github.workspace}}/build
shell: sh
run: |
export MD_FILES=$(ls ${{ env.SPECDIR }}gedcom*.md | sort)
python3 extract-grammars.py ${MD_FILES} ${{ env.EXTDIR }}
- name: Create GEDCOM Pull Request
uses: peter-evans/create-pull-request@v5
with:
add-paths: extracted-files
commit-message: Update extracted files
delete-branch: true
title: 'Update extracted-files in ${{ steps.extract_branch.outputs.branch }}'
body: |
Update extracted files
This PR is auto-generated by
[create-pull-request](https://github.com/peter-evans/create-pull-request).
labels: automated pr
base: "${{ steps.extract_branch.outputs.branch }}"