Skip to content

chore: sync-downloaded-files #11

chore: sync-downloaded-files

chore: sync-downloaded-files #11

Workflow file for this run

name: Init
permissions:
contents: write
actions: write
on:
push:
branches:
- main
jobs:
init:
if: github.repository != 'gendloop/template-GitbookProject'
runs-on: ubuntu-latest
steps:
- name: checkout-repo
uses: actions/checkout@v3
- name: get-repo-name
id: get-repo-name
shell: bash
run: |
repo_name=${GITHUB_REPOSITORY#*/}
echo "reponame=$repo_name" >> $GITHUB_OUTPUT
- name: replace-README
uses: gendloop/replace-str@v1.0.1
with:
token: ${{ github.token }}
path-to-replace: 'docs/README.md'
replace-to-path: 'README.md'
str-to-replace: 'REPO'
replace-to-str: ${{ steps.get-repo-name.outputs.reponame }}
- name: replace-book.json
uses: gendloop/replace-str@v1.0.1
with:
token: ${{ github.token }}
path-to-replace: 'book.json'
replace-to-path: 'book.json'
str-to-replace: 'template-GitbookProject'
replace-to-str: ${{ steps.get-repo-name.outputs.reponame }}
- name: clear-intro
working-directory: ${{ github.workspace }}
shell: bash
run: |
echo "" > INTRO.md
- name: remove-useless
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
Remove-Item .github\workflows\Init.yml
Remove-Item docs\README.md
- name: remove-sync-log
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
$file = "sync_log.md"
if(Test-Path $file) {
Remove-Item $file -Force
Write-Host "File $file deleted successfully."
}
else {
Write-Host "File $file does not exist."
}
- name: remove-useless-files-for-others
if: ${{ github.actor != 'gendloop' }}
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
Remove-Item scripts/downloadFilesFromRepo.json
Remove-Item .github/workflows/Sync_Download.yml
- name: git-push
uses: gendloop/git-push@v1.0.0
with:
token: ${{ github.token }}
commit: "chore: init project"