Skip to content

Commit

Permalink
Merge branch 'main' into auto-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
krrish-sehgal authored Nov 9, 2024
2 parents c13598b + 26ef12f commit b26eded
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
workflow_dispatch:
workflow_run:
workflows: ["Run djlint and Ruff"]
workflows: ["Pre-commit fix"]
types:
- completed

Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/pre-commit-fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

name: Pre-commit fix
on:
workflow_dispatch:
permissions:
contents: write
jobs:
run-pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pre-commit
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
run: |
. venv/bin/activate
pre-commit run --all-files
continue-on-error: true
- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Changes detected by pre-commit."
echo "::set-output name=changes_detected::true"
else
echo "No changes made by pre-commit."
echo "::set-output name=changes_detected::false"
fi
- name: Commit and push changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply pre-commit fixes"
git push origin HEAD:${{ github.ref_name }}
7 changes: 6 additions & 1 deletion .github/workflows/run-djlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ jobs:
files_to_check=$(find company/templates website/templates -type f -name "*.html")
djlint --reformat $files_to_check || true
- name: Run Ruff
- name: Run Ruff Fix
run: |
source venv/bin/activate
ruff check . --fix || true
- name: Run Ruff Format
run: |
source venv/bin/activate
ruff check . --format || true
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
Expand Down
7 changes: 6 additions & 1 deletion website/templates/monitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ <h1 class="text-2xl font-bold text-center text-gray-900 mb-6">Delete unwanted da
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Keyword
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
URL
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Status
</th>
</tr>
</thead>
<tbody>
{% for monitor in monitors %}
asdf
<tr>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
Expand All @@ -75,6 +77,9 @@ <h1 class="text-2xl font-bold text-center text-gray-900 mb-6">Delete unwanted da
</div>
</div>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">{{ monitor.url }}</p>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">{{ monitor.status }}</p>
</td>
Expand Down

0 comments on commit b26eded

Please sign in to comment.