Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Add precommit hook #8

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/pre_commit_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Check pre-commit rules

on:
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
pre_commit_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
fetch-depth: 20
- name: Fetch head and base refs
# This is necessary for pre-commit to check the changes in the PR branch (and to set origin/HEAD and HEAD refs)
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}:pr_ref
git checkout pr_ref
git remote set-head origin --auto
git merge-base origin/HEAD HEAD || ( echo "Your PR is far behind origin/HEAD, please rebase" && exit 1 )
- name: Set up Python environment
uses: actions/setup-python@master
with:
python-version: v3.8
- name: Install python packages
run: |
pip install pre-commit
pre-commit install-hooks
- name: Run pre-commit and check for any changes
run: |
echo "Commits being checked:"
git log --oneline --no-decorate origin/HEAD..HEAD
echo ""
if ! pre-commit run --from-ref origin/HEAD --to-ref HEAD --hook-stage manual --show-diff-on-failure ; then
echo ""
echo "::notice::It looks like the commits in this PR have been made without having pre-commit hooks installed."
echo "::notice::Please see https://github.com/espressif/esp-wifi-remote/CONTRIBUTING.md for instructions."
echo ""
exit 1
fi
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# esp-wifi-remote
# Wi-Fi remote

Enables Espressif WiFi capabilities on remote targets (without native WiFi support).

This repository contains components and utilities related to esp-wifi-remote.

## esp-wifi-remote

[![Component Registry](https://components.espressif.com/components/espressif/esp-wifi-remote/badge.svg)](https://components.espressif.com/components/espressif/esp-wifi-remote)

[esp_wifi_remote](https://github.com/espressif/esp-wifi-remote/tree/main/components/esp_wifi_remote/README.md)
Loading