Update weekly_crlftolf.yaml

This commit is contained in:
Alexandre
2023-12-25 07:18:39 +01:00
committed by GitHub
parent beec7c1f65
commit 9d6265de58

View File

@@ -1,45 +1,38 @@
# yamllint disable rule:line-length # yamllint disable rule:line-length
--- ---
name: Convert crlf to lf # This workflow finds and fixes CRLF endings in a repository
name: Fix CRLF Endings
on: on: push # Trigger the workflow on push event
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
env:
USER_AGENT: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0"
jobs: jobs:
build: fix-crlf:
runs-on: ubuntu-latest name: Fix CRLF Endings
runs-on: ubuntu-latest # Use a Linux runner
permissions:
contents: write
steps: steps:
- name: Checkout repository - name: Checkout repository contents
uses: actions/checkout@v4 uses: actions/checkout@v2 # Use the checkout action
- name: Find files with CRLF endings
uses: erclu/check-crlf@v1.2.0 # Use the check-crlf action
id: check-crlf # Assign an id to this step
with: with:
path: main # Specify the paths to check
path: |
- name: Setup Env ./*
!.git
!*.png
!*.jpg
!*.bin
- name: Apply dos2unix to files with CRLF endings
run: | run: |
sudo apt update -y # Loop through each file and apply dos2unix
sudo apt install dos2unix -y for f in ${{ steps.check-crlf.outputs.files }}; do
# Apply dos2unix and keep the original timestamp
- name: Dos2Unix Everything dos2unix -k "$f"
run: | done
#Presets - name: Create a pull request with the fixed files
set +x ; set +e uses: peter-evans/create-pull-request@v3 # Use the create-pull-request action
#--------------#
cd "$GITHUB_WORKSPACE/main"
find . -type f ! -path "./.git/*" -exec dos2unix {} \; 2>/dev/null
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v4
with: with:
repository: ./main # Specify the pull request details
commit_message: "✅ Dos2Unix-fied 🐧🖳 Everything " title: Fix CRLF Endings
#push_options: '--force' commit-message: Apply dos2unix to files with CRLF endings
branch: fix-crlf-endings
delete-branch: true