Update extracted files (#441) #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This action will copy changes from main into the next-minor branch, 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 ] | |
permissions: | |
contents: read | |
jobs: | |
merge-to-next-minor: | |
permissions: | |
contents: write # for Git to git push | |
pull-requests: write # for Git to create a pull request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out GEDCOM | |
uses: actions/checkout@v4 | |
- name: Set git config | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)" | |
git config -l | |
- name: Check for diffs | |
id: diff | |
run: | | |
git fetch origin | |
git diff --quiet origin/main..origin/next-minor || echo "::set-output name=status::changes" | |
- name: Create Pull Request | |
if: steps.diff.outputs.status == 'changes' | |
run: | | |
git checkout -b merge-main-into-next-minor | |
git push -f --set-upstream origin merge-main-into-next-minor | |
if ! gh pr list | grep -q "merge-main-into-next-minor"; then | |
gh pr create -B next-minor -H merge-main-into-next-minor --title 'Merge main into next-minor' --body $'Copy changes from main to next-minor\nThis PR is auto-generated by [gh pr create].' --label 'automated pr' --repo ${{ github.repository }} | |
fi | |
env: | |
GH_TOKEN: ${{ github.token }} |