Formatter #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Formatter | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 1,15 * *' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Build formatter | |
run: dotnet publish .\src\Formatter\Formatter.csproj -c Release -o ./ -r win-x64 -p:PublishSingleFile=true | |
- name: Run formatter | |
run: .\Formatter | |
# - name: Commit files | |
# run: | | |
# ri .\Formatter.exe -Force | |
# git config http.sslVerify false | |
# git config user.name "github-actions[bot]" | |
# git config user.email "actions@users.noreply.github.com" | |
# git pull origin HEAD:${{ github.ref }} | |
# git add . | |
# git commit -m "Update file" | |
# git push origin HEAD:${{ github.ref }} | |
- name: Commit report | |
run: | | |
$ErrorActionPreference ='Continue' | |
ri .\Formatter.exe -Force | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'actions@users.noreply.github.com' | |
git add . | |
git commit -m "[Formatter]Update file" | |
shell: pwsh | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
# - name: Push changes | |
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
# git config --local user.name "github-actions[bot]" | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# branch: ${{ github.ref }} | |
# - name: Push to github | |
# if: ${{github.event}} == 'push' | |
# run: | | |
# ri .\Formatter.exe -Force | |
# $ErrorActionPreference ='Continue' | |
# git config --global credential.helper manager | |
# git config --global user.email "fanng233@gmail.com" | |
# git config --global user.name "CfpaBot" | |
# @" | |
# protocol=https | |
# host=github.com | |
# username=baka-gourd | |
# password=${{secrets.BAKA_GOURD_TOKEN}} | |
# "@ > .\1.txt | |
# gc 1.txt|git credential-manager store | |
# ri .\1.txt -Force | |
# git add . | |
# git commit -m "Format file" | |
# git push origin HEAD:${{ github.ref }} |