Skip to content

Commit

Permalink
Prevent duplicate commit + PR django-test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Oct 8, 2024
1 parent 40f3e88 commit 733d6f3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/django-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,28 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Check if event is a push to PR branch
id: check_event
run: |
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.head_ref }}" != "" ]; then
echo "Skipping duplicate workflow run for push to PR branch."
exit 78 # Exit with neutral status to mark as skipped
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
if: success()

- name: Install Dependencies
if: success()
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
if: success()
run: |
cd app && python manage.py test

0 comments on commit 733d6f3

Please sign in to comment.