
Some checks failed
Java 22 CI / buildtgz-jdk22 (push) Failing after 1m5s
Java CI / buildtgz (push) Failing after 56s
Nightly Release / build (push) Failing after 22m21s
Nightly 22 Release / build (push) Failing after 20m15s
Java 22 CI / nsis-jdk22 (push) Has been cancelled
Java 22 CI / buildjpackagexe-jdk22 (push) Has been cancelled
Java 22 CI / buildjpackagmsi-jdk22 (push) Has been cancelled
Java 22 CI / buildzip-jdk22 (push) Has been cancelled
Java CI / nsis (push) Has been cancelled
Java CI / buildjpackagexe (push) Has been cancelled
Java CI / buildjpackagmsi (push) Has been cancelled
Java CI / buildzip (push) Has been cancelled
Sync Primary Repository to GitHub Mirror / sync (push) Has been cancelled
67 lines
2.3 KiB
YAML
67 lines
2.3 KiB
YAML
# GitHub Actions workflow file to sync an external repository to this GitHub mirror.
|
|
# This file was automatically generated by go-github-sync.
|
|
#
|
|
# The workflow does the following:
|
|
# - Runs on a scheduled basis (and can also be triggered manually)
|
|
# - Clones the GitHub mirror repository
|
|
# - Fetches changes from the primary external repository
|
|
# - Applies those changes to the mirror repository
|
|
# - Pushes the updated content back to the GitHub mirror
|
|
#
|
|
# Authentication is handled by the GITHUB_TOKEN secret provided by GitHub Actions.
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Validate Github Actions Environment
|
|
run: if [ "$GITHUB_ACTIONS" != "true" ]; then echo 'This script must be run in a GitHub Actions environment.'; exit 1; fi
|
|
- name: Checkout GitHub Mirror
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Configure Git
|
|
run: |-
|
|
git config user.name 'GitHub Actions'
|
|
git config user.email 'actions@github.com'
|
|
- env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
name: Sync Primary Repository
|
|
run: |-
|
|
# Add the primary repository as a remote
|
|
git remote add primary https://i2pgit.org/I2P_Developers/i2p.firefox.git
|
|
|
|
# Fetch the latest changes from the primary repository
|
|
git fetch primary
|
|
|
|
# Check if the primary branch exists in the primary repository
|
|
if git ls-remote --heads primary master | grep -q master; then
|
|
echo "Primary branch master found in primary repository"
|
|
else
|
|
echo "Error: Primary branch master not found in primary repository"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if we're already on the mirror branch
|
|
if git rev-parse --verify --quiet master; then
|
|
git checkout master
|
|
else
|
|
# Create the mirror branch if it doesn't exist
|
|
git checkout -b master
|
|
fi
|
|
|
|
|
|
# Force-apply all changes from primary, overriding any conflicts
|
|
echo "Performing force sync from primary/master to master"
|
|
git reset --hard primary/master
|
|
|
|
|
|
# Push changes back to the mirror repository
|
|
git push origin master
|
|
name: Sync Primary Repository to GitHub Mirror
|
|
"on":
|
|
push: {}
|
|
schedule:
|
|
- cron: 0 * * * *
|
|
workflow_dispatch: {}
|