diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 0000000..b177486 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,38 @@ +name: Mirror to forge + +# The maintainer's own forge (git.swaits.com) holds the primary repository and +# this GitHub repository mirrors it. Pull requests are merged here, so every +# push to main is passed on to the forge. A push that came from the forge is +# already there and changes nothing. The push is never forced: if the two have +# diverged this job fails and a person sorts it out. + +on: + push: + branches: [main] + +concurrency: + group: mirror-to-forge + cancel-in-progress: false + +permissions: + contents: read + +jobs: + mirror: + if: github.repository == 'swaits/longhikes' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Push main to the forge + env: + FORGE_SSH_KEY: ${{ secrets.FORGE_SSH_KEY }} + FORGE_KNOWN_HOSTS: ${{ secrets.FORGE_KNOWN_HOSTS }} + run: | + install -m 700 -d "$HOME/.ssh" + printf '%s\n' "$FORGE_SSH_KEY" > "$HOME/.ssh/forge_key" + chmod 600 "$HOME/.ssh/forge_key" + printf '%s\n' "$FORGE_KNOWN_HOSTS" > "$HOME/.ssh/forge_known_hosts" + export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/forge_key -o IdentitiesOnly=yes -o UserKnownHostsFile=$HOME/.ssh/forge_known_hosts -o StrictHostKeyChecking=yes" + git push ssh://git@git.swaits.com:2222/swaits/longhikes.git "$GITHUB_SHA:refs/heads/main" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d06bf51..b0d56c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Thank you for helping correct or extend this dataset. Please keep changes small: ## How to send a change -Issues and pull requests are taken at https://github.com/swaits/longhikes. That repository mirrors the maintainer's own; a change accepted there reaches both. +Issues and pull requests are taken at https://github.com/swaits/longhikes. That repository mirrors the maintainer's own, https://git.swaits.com/swaits/longhikes; a change accepted on GitHub is passed on to it automatically. - You do not need git to report something. Every trail's page on https://longhikes.org has a "Report a problem" link that opens a short form, and the repository's issue forms cover a wrong record, a missing trail, and a request from a steward or creator to remove or re-credit a track or a logo. - To fix a record yourself, use "Edit this record" on the trail's page, or edit `/trail.toml` in a fork, and open a pull request. Say where each changed fact can be checked.