Download .github/workflows/csv_linter.yml from gitaction/chatgpt.actions: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/gitaction/chatgpt.actions/resolve/main/.github/workflows/csv_linter.yml
- Command line
-
hf download hf://gitaction/chatgpt.actions/.github/workflows/csv_linter.yml
-
curl -L -o csv_linter.yml https://huggingface.co/gitaction/chatgpt.actions/resolve/main/.github/workflows/csv_linter.yml
1.09 kB
| name: CSV Linter and Trailing Whitespaces | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| lint_and_check_trailing_whitespaces: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install csvkit | |
| - name: Lint CSV files | |
| run: find . -name "*.csv" -exec csvclean -n -u 2 {} + | |
| env: | |
| CI: true | |
| - name: Check for errors | |
| if: always() | |
| run: | | |
| if ! grep -q "No errors." <(find . -name "*.csv" -exec csvclean -n -u 2 {} + | grep -v "^$"); then | |
| echo "Errors were found in one or more CSV files." | |
| exit 1 | |
| fi | |
| - name: Check Trailing Whitespaces | |
| run: | | |
| # Check if the special file contains any trailing whitespaces | |
| if grep -q "[[:space:]]$" ./actions.csv; then | |
| echo "ERROR: Found trailing whitespaces in actions.csv" | |
| exit 1 | |
| else | |
| echo "No trailing whitespaces found in actions.csv" | |
| fi | |