148 lines
4.2 KiB
YAML
148 lines
4.2 KiB
YAML
name: Optimize Repository
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 1 */3 *'
|
|
|
|
jobs:
|
|
master:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: master
|
|
|
|
- name: Run git cleanup commands
|
|
run: |
|
|
git reflog expire --expire=now --all
|
|
git gc --aggressive --prune=now
|
|
|
|
- name: Clear commit history
|
|
run: |
|
|
git config --local user.email "${{ secrets.MYEMAIL }}"
|
|
git config --local user.name "${{ secrets.MYUSERNAME }}"
|
|
git checkout --orphan temp_branch
|
|
git add .
|
|
git commit -m "clear"
|
|
git branch -D master
|
|
git branch -m master
|
|
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
git push -f origin master
|
|
|
|
developer:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: developer
|
|
|
|
- name: Run git cleanup commands
|
|
run: |
|
|
git reflog expire --expire=now --all
|
|
git gc --aggressive --prune=now
|
|
|
|
- name: Clear commit history
|
|
run: |
|
|
git config --local user.email "${{ secrets.MYEMAIL }}"
|
|
git config --local user.name "${{ secrets.MYUSERNAME }}"
|
|
git checkout --orphan temp_branch
|
|
git add .
|
|
git commit -m "clear"
|
|
git branch -D developer
|
|
git branch -m developer
|
|
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
git push -f origin developer
|
|
|
|
Feature:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: Feature
|
|
|
|
- name: Run git cleanup commands
|
|
run: |
|
|
git reflog expire --expire=now --all
|
|
git gc --aggressive --prune=now
|
|
|
|
- name: Clear commit history
|
|
run: |
|
|
git config --local user.email "${{ secrets.MYEMAIL }}"
|
|
git config --local user.name "${{ secrets.MYUSERNAME }}"
|
|
git checkout --orphan temp_branch
|
|
git add .
|
|
git commit -m "clear"
|
|
git branch -D Feature
|
|
git branch -m Feature
|
|
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
git push -f origin Feature
|
|
|
|
Feature1:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: Feature1
|
|
|
|
- name: Run git cleanup commands
|
|
run: |
|
|
git reflog expire --expire=now --all
|
|
git gc --aggressive --prune=now
|
|
|
|
- name: Clear commit history
|
|
run: |
|
|
git config --local user.email "${{ secrets.MYEMAIL }}"
|
|
git config --local user.name "${{ secrets.MYUSERNAME }}"
|
|
git checkout --orphan temp_branch
|
|
git add .
|
|
git commit -m "clear"
|
|
git branch -D Feature1
|
|
git branch -m Feature1
|
|
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
git push -f origin Feature1
|
|
|
|
PC_For_Test:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: PC_For_Test
|
|
|
|
- name: Run git cleanup commands
|
|
run: |
|
|
git reflog expire --expire=now --all
|
|
git gc --aggressive --prune=now
|
|
|
|
- name: Clear commit history
|
|
run: |
|
|
git config --local user.email "${{ secrets.MYEMAIL }}"
|
|
git config --local user.name "${{ secrets.MYUSERNAME }}"
|
|
git checkout --orphan temp_branch
|
|
git add .
|
|
git commit -m "clear"
|
|
git branch -D PC_For_Test
|
|
git branch -m PC_For_Test
|
|
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
|
|
git push -f origin PC_For_Test
|