Skip to content

回滚更新

回滚更新 #37

Workflow file for this run

name: CRLF To LF
on:
push:
branches:
- 'main'
env:
GITHUB_USER: "${{secrets.USERNAME}}"
GITHUB_EMAIL: "${{secrets.EMAIL}}"
GITHUB_TOKEN: "${{secrets.API_TOKEN_GITHUB}}"
GIT_CLONE: "${{ github.workspace }}/git_clone"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y dos2unix ssh git
- name: CRLF to LF
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
mkdir -vp ${GIT_CLONE}
git clone https://"${GITHUB_USER}":"${GITHUB_TOKEN}"@github.com/chase535/accurate_battery.git ${GIT_CLONE} -b main --depth=1
cd ${GIT_CLONE}
files=$(find . -type f -not -path "./.git/*")
dos2unix ${files}
if [ -n "$(git diff)" ]; then
git add . -f
git commit -a -m "换行符CRLF转LF"
git push origin main -f
fi