FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ci: add mirroring job by Miou-zora · Pull Request #2 · EngineSquared/EngineSquared · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .yml  (1) All 1 file type selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
60 changes: 60 additions & 0 deletions .github/workflows/mirror.yml
This file contains hidden or 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: mirror

on:
push:
branches-ignore:
- 'ga-ignore-**'
pull_request:
branches-ignore:
- 'ga-ignore-**'

env:
MIRROR_URL: "git@github.com:EpitechPromo2026/G-EIP-700-NAN-7-1-eip-lucas.hauszler.git"

jobs:
check_repository_cleanliness:
name: Checks if the repository is clean and void of any unwanted files (temp files, binary files, etc.)
runs-on: ubuntu-latest
env:
UNWANTED_REGEX: ^(?!.*tests\/).*gc(no|da|ov)$|(.*\.(a|o|so))$|(.*~)$|^(#.*#)$|^tmp\/.*|.*\/tmp\/.*
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Find temp files in all directories
run: |
UNWANTED_FILES=$(find . -type f -printf '%P\n' | { grep -P "${{ env.UNWANTED_REGEX }}" || true; })
if [ "$UNWANTED_FILES" != "" ]; then
IFS=$'\n'$'\r'
for LINE in $UNWANTED_FILES; do
echo "::error file=${LINE},line=1,col=1,title=Unwanted file detected::${LINE}"
done
echo "FAIL_TASK=true" >> "$GITHUB_ENV"
else
echo "FAIL_TASK=false" >> "$GITHUB_ENV"
fi

- name: Fail if needed
if: env.FAIL_TASK == 'true'
run: exit 1

push_to_mirror:
name: Pushes the current repository files to a given mirror repository
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [check_repository_cleanliness]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Push mirror repository
uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
${{ env.MIRROR_URL }}
ssh_private_key:
${{ secrets.GIT_SSH_PRIVATE_KEY }}

Back | FazBrowse Home | New Git URL