forked from 6Kmfi6HP/EDtunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.22 KB
/
create.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: "🌲 Create many branches"
on:
workflow_dispatch:
jobs:
create_branches:
runs-on: ubuntu-latest
name: "🌲 Create and push branches"
env:
EMAIL: ${{ secrets.GH_EMAIL }}
NAME: ${{ secrets.GH_USERNAME }}
TOKEN: ${{ secrets.TOKEN }}
REMOTE_NAME: origin
BRANCH_BASE_NAME: proxyip
BRANCH_COUNT: 300
steps:
- name: ⚙️ Set up Git config
run: |
git config --global user.email "${{ env.EMAIL }}"
git config --global user.name "${{ env.NAME }}"
- name: 📦 Clone repository
run: |
git clone https://${{ env.TOKEN }}@github.com/${{github.repository}}.git
cd $(echo ${{github.repository}} | awk -F'/' '{print $2}')
- name: 🌿 Create and push branches
run: |
cd $(echo ${{github.repository}} | awk -F'/' '{print $2}')
for ((i=1; i<=${{ env.BRANCH_COUNT }}; i++)); do
branch_name="${{ env.BRANCH_BASE_NAME }}${i}"
git branch $branch_name
git checkout $branch_name
git commit --allow-empty -m "Create branch ${branch_name}"
git push ${{ env.REMOTE_NAME }} $branch_name
git checkout main
done