Skip to content

Commit

Permalink
Get github actions working for both pull requests and pushes based on h…
Browse files Browse the repository at this point in the history
  • Loading branch information
invisibleroads committed May 24, 2024
1 parent 1ddb626 commit 2c7bebf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/test.yml → .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
---
name: Validate CSV
name: Format CSVs
on:
pull_request_target:
branches:
- main
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r linters/requirements.txt
- run: python linters/autoformat-csv.py
- run: python linters/lint-csv.py
- run: python linters/format.py
- run: python linters/validate.py
- run: |
git config user.name 'Jon Banafato'
git config user.email '[email protected]'
git diff --quiet || git commit -am "Autoformat CSV"
git diff --quiet || git commit -am "Autoformat CSVs"
git push
16 changes: 16 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Validate CSVs
on:
pull_request:
branches:
- main
jobs:
test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r linters/requirements.txt
- run: python linters/validate.py
File renamed without changes.
File renamed without changes.

0 comments on commit 2c7bebf

Please sign in to comment.