mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-06-29 18:47:38 +00:00
New workflow to push to gitea and change links (#5510)
This commit is contained in:
committed by
GitHub
parent
650a5f5df5
commit
03d2a76ff1
44
.github/workflows/push-to-gitea.yaml
generated
vendored
Normal file
44
.github/workflows/push-to-gitea.yaml
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
name: Sync to Gitea
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
if: github.repository == 'community-scripts/ProxmoxVE'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Change all links to git.community-scripts.org
|
||||
run: |
|
||||
echo "Searching for files containing raw.githubusercontent.com URLs..."
|
||||
|
||||
# Find all files containing GitHub raw URLs, excluding certain directories
|
||||
files_with_github_urls=$(grep -r "https://raw.githubusercontent.com/community-scripts/ProxmoxVE" . --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.github/workflows --files-with-matches || true)
|
||||
|
||||
if [ -n "$files_with_github_urls" ]; then
|
||||
echo "$files_with_github_urls" | while read file; do
|
||||
if [ -f "$file" ]; then
|
||||
sed -i 's|https://raw\.githubusercontent\.com/community-scripts/ProxmoxVE/|https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/|g' "$file"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No files found containing GitHub raw URLs"
|
||||
fi
|
||||
|
||||
- name: Push to Gitea
|
||||
run: |
|
||||
git config --global user.name "Push From Github"
|
||||
git config --global user.email "actions@github.com"
|
||||
git remote add gitea https://$GITEA_USER:$GITEA_TOKEN@git.community-scripts.org/community-scripts/ProxmoxVE.git
|
||||
git push gitea --all
|
||||
env:
|
||||
GITEA_USER: ${{ secrets.GITEA_USERNAME }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
Reference in New Issue
Block a user