Sync all projects
This commit is contained in:
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
name: Clean up the garbage
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 4 7 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout target repo
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install git-filter-repo
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3-pip
|
||||
pip3 install git-filter-repo
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Compressing
|
||||
run: |
|
||||
git prune-packed
|
||||
git reflog expire --expire=now --all
|
||||
git gc --prune=now --aggressive
|
||||
|
||||
- name: Force Push Changes
|
||||
run: |
|
||||
git push origin --force --all
|
||||
git push origin --force --tags
|
||||
|
||||
- name: Reset History
|
||||
run: |
|
||||
git checkout --orphan latest_branch
|
||||
git add -A
|
||||
git commit -m "purge history"
|
||||
git branch -D main
|
||||
git branch -m main
|
||||
|
||||
- name: Force Push to Remote
|
||||
run: |
|
||||
git push -f origin main
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
name: Update md5
|
||||
|
||||
on:
|
||||
# 监听代码推送
|
||||
push:
|
||||
# 只有当 .js 和 .jar 文件发生变化时才触发,避免无意义运行
|
||||
paths:
|
||||
- '**.js'
|
||||
- '**.jar'
|
||||
|
||||
permissions:
|
||||
contents: write # 'write' access to repository contents
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
jobs:
|
||||
generate-md5:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
|
||||
fetch-depth: 0 # 获取完整历史,方便提交
|
||||
|
||||
- name: Calculate & Update MD5
|
||||
run: |
|
||||
echo "Start scanning all .js and .jar files..."
|
||||
|
||||
# Match both .js and .jar files
|
||||
find . -type f \( -name "*.js" -o -name "*.jar" \) -not -path '*/.git/*' | while read -r file; do
|
||||
|
||||
currentMd5=$(md5sum "$file" | awk '{print $1}')
|
||||
targetFile="${file}.md5"
|
||||
|
||||
echo "$currentMd5" > "$targetFile"
|
||||
|
||||
echo "Updated: $targetFile -> $currentMd5"
|
||||
done
|
||||
|
||||
- name: Submit the changes
|
||||
run: |
|
||||
# Configure bot identity
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# Stage both js and jar md5 files
|
||||
# git add "*.js.md5" "*.jar.md5"
|
||||
|
||||
# if ! git diff-index --quiet HEAD; then
|
||||
# git commit -m "Update md5"
|
||||
# git push
|
||||
# echo "::notice::MD5 files updated and pushed."
|
||||
# else
|
||||
# echo "::notice::No changes in MD5 values, skipping commit."
|
||||
# fi
|
||||
|
||||
git commit -a -m "Update md5"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true
|
||||
|
||||
Vendored
+100
@@ -0,0 +1,100 @@
|
||||
# Simple workflow for deploying static content to GitHub Pages
|
||||
name: Update Deploy to Pages
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DEPLOY_REF: ${{ github.event.inputs.deploy_branch || github.ref }}
|
||||
UPLOAD_PATH: "."
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
# pull-requests: write # 'write' access to pull requests
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Single deploy job since we're just deploying
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
fetch-depth: 1
|
||||
lfs: true
|
||||
|
||||
- name: 🔄 Auto Commit Timestamp
|
||||
if: github.event_name == 'schedule'
|
||||
run: |
|
||||
cd ${{ env.UPLOAD_PATH }}
|
||||
echo "Last deployment run at: $(date)" > last_run.txt
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add last_run.txt
|
||||
if ! git diff-index --quiet HEAD; then
|
||||
git commit -m "🤖 Auto-update: Scheduled deployment [skip ci]"
|
||||
git push
|
||||
echo "::notice::✅ 已自动提交更新时间戳"
|
||||
else
|
||||
echo "::notice::⚠️ 无文件变更,跳过提交"
|
||||
fi
|
||||
|
||||
- name: Verify & Generate CNAME
|
||||
run: |
|
||||
echo "clun.top" > ${{ env.UPLOAD_PATH }}/CNAME
|
||||
FILE_COUNT=$(find ${{ env.UPLOAD_PATH }} -type f | wc -l)
|
||||
SIZE=$(du -sh ${{ env.UPLOAD_PATH }} | cut -f1)
|
||||
|
||||
echo "### 📦 部署准备就绪" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **分支**: \`${{ env.DEPLOY_REF }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **文件数量**: $FILE_COUNT" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **总大小**: $SIZE" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
if [ "$FILE_COUNT" -eq 0 ]; then
|
||||
echo "::error::❌ 目录下没有文件,终止部署!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v6
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
# Upload entire repository
|
||||
path: ${{ env.UPLOAD_PATH }}
|
||||
retention-days: 1
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v5
|
||||
|
||||
- name: Deployment Success Info
|
||||
if: success()
|
||||
run: |
|
||||
echo "::notice title=部署成功::✅ 您的站点已上线!"
|
||||
echo "### 🚀 部署成功!" >> $GITHUB_STEP_SUMMARY
|
||||
echo "访问地址: [${{ steps.deployment.outputs.page_url }}](${{ steps.deployment.outputs.page_url }})" >> $GITHUB_STEP_SUMMARY
|
||||
Vendored
+80
@@ -0,0 +1,80 @@
|
||||
name: Upstream Sync
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 * * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
upstream_branch:
|
||||
description: "上游仓库分支"
|
||||
required: true
|
||||
default: "main"
|
||||
type: string
|
||||
target_branch:
|
||||
description: "目标仓库分支"
|
||||
required: true
|
||||
default: "main"
|
||||
type: string
|
||||
sync_strategy:
|
||||
description: "同步策略"
|
||||
required: true
|
||||
default: "discard"
|
||||
type: choice
|
||||
options:
|
||||
- discard # 强制同步:丢弃本地修改,完全复制上游 (推荐)
|
||||
- merge # 尝试合并:如果有冲突会报错
|
||||
|
||||
env:
|
||||
UPSTREAM_REPO: "cluntop/tvbox"
|
||||
UPSTREAM_BRANCH: ${{ github.event.inputs.upstream_branch || 'main' }}
|
||||
TARGET_BRANCH: ${{ github.event.inputs.target_branch || 'main' }}
|
||||
SYNC_STRATEGY: ${{ github.event.inputs.sync_strategy || 'discard' }}
|
||||
|
||||
jobs:
|
||||
sync_upstream:
|
||||
name: Sync and Notify
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.repository.fork }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Target Repo
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ env.TARGET_BRANCH }}
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
persist-credentials: true
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Sync Upstream Changes
|
||||
id: sync
|
||||
uses: aormsby/[email protected]
|
||||
with:
|
||||
upstream_sync_repo: ${{ env.UPSTREAM_REPO }}
|
||||
upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }}
|
||||
target_sync_branch: ${{ env.TARGET_BRANCH }}
|
||||
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
upstream_pull_args: ${{ env.SYNC_STRATEGY == 'discard' && '--allow-unrelated-histories --force' || '' }}
|
||||
target_branch_push_args: ${{ env.SYNC_STRATEGY == 'discard' && '--force' || '' }}
|
||||
test_mode: false
|
||||
|
||||
- name: Generate Summary
|
||||
run: |
|
||||
echo "### 🔄 同步报告 (Sync Report)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| :--- | :--- |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| **源仓库** | [${{ env.UPSTREAM_REPO }}](https://github.com/${{ env.UPSTREAM_REPO }}) |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| **结果** | ${{ steps.sync.outputs.sync_status == 'success' && '✅ 成功 (Success)' || '❌ 失败 (Failed)' }} |" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: Delete Old Workflows
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
Vendored
+97
@@ -0,0 +1,97 @@
|
||||
name: Update Test
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: '30 2 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: self-hosted
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Delete old workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
|
||||
#- name: Set up Python
|
||||
# uses: actions/setup-python@v6
|
||||
# with:
|
||||
# python-version: '3.10'
|
||||
# cache: 'pip'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
# if [ -f .github/requirements.txt ]; then pip install -r .github/requirements.txt; fi
|
||||
pip install aiohttp playwright
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libasound2t64 libgbm-dev libnotify-dev libnss3 libxss1 \
|
||||
libxcomposite1 libxdamage1 libxrandr2 libxcursor1 libxkbcommon0 \
|
||||
libpango-1.0-0 libcairo2 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64
|
||||
|
||||
- name: Initialize chromium
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
playwright install chromium
|
||||
# playwright install-deps chromium
|
||||
|
||||
- name: Run M3U script
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
python py/sinparty.py
|
||||
|
||||
- name: Submit the changes
|
||||
run: |
|
||||
export HOME=${GITHUB_WORKSPACE}
|
||||
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# if [ -n "$(git status --porcelain)" ]; then
|
||||
# echo "Changes detected, committing..."
|
||||
# git add .
|
||||
# git commit -m "Update Test"
|
||||
|
||||
# git pull --rebase origin main
|
||||
# git push origin main
|
||||
# else
|
||||
# echo "No changes detected, skipping push."
|
||||
# fi
|
||||
|
||||
git commit -a -m "Update test"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true
|
||||
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
name: Update Toos
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Delete old workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f .github/requirements.txt ]; then pip install -r .github/requirements.txt; fi
|
||||
pip install aiohttp
|
||||
|
||||
- name: Run M3U script
|
||||
run: |
|
||||
python py/ssjh.py
|
||||
|
||||
- name: Submit the changes
|
||||
run: |
|
||||
export HOME=${GITHUB_WORKSPACE}
|
||||
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# if [ -n "$(git status --porcelain)" ]; then
|
||||
# echo "Changes detected, committing..."
|
||||
# git add .
|
||||
# git commit -m "Update m3u"
|
||||
|
||||
# git pull --rebase origin main
|
||||
# git push origin main
|
||||
# else
|
||||
# echo "No changes detected, skipping push."
|
||||
# fi
|
||||
|
||||
git commit -a -m "Update m3u"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true
|
||||
|
||||
Vendored
+81
@@ -0,0 +1,81 @@
|
||||
name: Update m3u
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '1 * * * *' # 每小时执行一次
|
||||
workflow_dispatch: # 允许手动触发
|
||||
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Delete old workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f .github/requirements.txt ]; then pip install -r .github/requirements.txt; fi
|
||||
pip install pandas requests
|
||||
|
||||
- name: Run IPTV script
|
||||
run: |
|
||||
python py/get_iptv.py
|
||||
|
||||
- name: Submit the changes
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# if [ -n "$(git status --porcelain)" ]; then
|
||||
# echo "Changes detected, committing..."
|
||||
# git add .
|
||||
# git commit -m "Update m3u"
|
||||
|
||||
# git pull --rebase origin main
|
||||
# git push origin main
|
||||
# else
|
||||
# echo "No changes detected, skipping push."
|
||||
# fi
|
||||
|
||||
git commit -a -m "Update m3u"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true
|
||||
|
||||
Vendored
+101
@@ -0,0 +1,101 @@
|
||||
name: Update zip
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
pull-requests: write # 'write' access to pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *' # 每小时运行一次
|
||||
workflow_dispatch: # 允许手动触发
|
||||
|
||||
env:
|
||||
TZ: Asia/Shanghai # 设置时区
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Delete old records
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 5
|
||||
|
||||
- name: Checkout target repo
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
repository: cluntop/tvbox
|
||||
token: ${{ secrets.GIT_TOKEN }}
|
||||
path: target-repo
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Process Xiaosa resource
|
||||
run: |
|
||||
echo "Starting Xiaosa download..."
|
||||
|
||||
mkdir -p temp_xiaosa
|
||||
cd temp_xiaosa
|
||||
wget --tries=3 --timeout=30 https://github.com/PizazzGY/NewTVBox/raw/main/%E5%8D%95%E7%BA%BF%E8%B7%AF.zip -O xiaosa.zip
|
||||
unzip -q xiaosa.zip
|
||||
mkdir -p ../target-repo/js/xiaosa
|
||||
|
||||
if [ -d "TVBoxOSC/tvbox" ]; then
|
||||
cp -rf TVBoxOSC/tvbox/* ../target-repo/js/xiaosa/
|
||||
echo "Xiaosa files copied successfully."
|
||||
else
|
||||
echo "Error: Xiaosa source directory structure changed."
|
||||
ls -R
|
||||
fi
|
||||
|
||||
cd ..
|
||||
rm -rf temp_xiaosa
|
||||
|
||||
#- name: Process Source Repo
|
||||
# run: |
|
||||
#git clone --depth 1 https://github.com/fish2018/PG.git source-repo
|
||||
|
||||
#cd source-repo
|
||||
#ZIP_FILE=$(find . -type f -name "pg.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9].zip" | sort -r | head -n 1)
|
||||
|
||||
#if [ -z "$ZIP_FILE" ]; then
|
||||
#echo "Warning: No matching zip file found in Source Repo."
|
||||
#else
|
||||
#echo "Found zip file: $ZIP_FILE"
|
||||
|
||||
#unzip -o "$ZIP_FILE" -x "README.txt" -d ../target-repo/
|
||||
#echo "PG zip extracted to target repo."
|
||||
#fi
|
||||
|
||||
- name: Submit the changes
|
||||
working-directory: target-repo
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# git add .
|
||||
|
||||
# if git diff --staged --quiet; then
|
||||
# echo "No changes to commit."
|
||||
# exit 0
|
||||
# else
|
||||
# COMMIT_MSG="Update zip"
|
||||
# git commit -m "$COMMIT_MSG"
|
||||
|
||||
# git push origin HEAD:main
|
||||
# echo "Changes pushed successfully."
|
||||
# fi
|
||||
|
||||
git commit -a -m "Update zip"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
# pull: rebase # pull --rebase before push; also accepts: merge | ff-only | true
|
||||
|
||||
Reference in New Issue
Block a user