From f9a111f8d83d53aeca5fa55298495c9c1f007f37 Mon Sep 17 00:00:00 2001 From: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> Date: Sun, 14 Sep 2025 04:35:20 +0000 Subject: [PATCH] Minor Fixes --- .github/workflows/dependabot-pr.yaml | 18 +++++------------- .github/workflows/pre-commit-pr.yaml | 13 +++++-------- .github/workflows/readme-checker.yaml | 18 ------------------ .pre-commit-config.yaml | 14 ++++++-------- 4 files changed, 16 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/readme-checker.yaml diff --git a/.github/workflows/dependabot-pr.yaml b/.github/workflows/dependabot-pr.yaml index c03e93a..ce3f12f 100644 --- a/.github/workflows/dependabot-pr.yaml +++ b/.github/workflows/dependabot-pr.yaml @@ -6,20 +6,12 @@ permissions: jobs: dependabot: runs-on: ubuntu-latest - if: github.event.pull_request.user.login == 'dependabot[bot]' + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.user.type == 'Bot' steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --merge "$PR_URL" + - name: Approve & Auto-Merge PR + run: | + gh pr review --approve "${PR_URL}" + gh pr merge --auto --squash "${PR_URL}" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/pre-commit-pr.yaml b/.github/workflows/pre-commit-pr.yaml index d423c43..0850d36 100644 --- a/.github/workflows/pre-commit-pr.yaml +++ b/.github/workflows/pre-commit-pr.yaml @@ -6,15 +6,12 @@ permissions: jobs: pre-commit: runs-on: ubuntu-latest - if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' + if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' && github.event.pull_request.user.type == 'Bot' steps: - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Enable auto-merge for pre-commit PRs - run: gh pr merge --auto --merge "$PR_URL" + - name: Approve & Auto-Merge PR + run: | + gh pr review --approve "${PR_URL}" + gh pr merge --auto --squash "${PR_URL}" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/readme-checker.yaml b/.github/workflows/readme-checker.yaml deleted file mode 100644 index c8ecbcb..0000000 --- a/.github/workflows/readme-checker.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Markdown Lint -on: - pull_request: -permissions: - contents: write -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v5 - - name: Markdown Lint - uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e - with: - fix: true - globs: | - *.md - !test/*.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eca1520..d0e7a86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,29 +9,21 @@ repos: rev: "v6.0.0" hooks: - id: check-added-large-files - - id: check-ast - - id: check-builtin-literals - id: check-case-conflict - - id: check-docstring-first - id: check-executables-have-shebangs - id: check-json - id: check-merge-conflict - id: check-shebang-scripts-are-executable - id: check-symlinks - - id: check-toml - id: check-vcs-permalinks - - id: check-xml - id: check-yaml - - id: debug-statements - id: destroyed-symlinks - id: double-quote-string-fixer - id: end-of-file-fixer - id: fix-byte-order-marker - id: mixed-line-ending - - id: name-tests-test - id: pretty-format-json args: [--autofix] - - id: requirements-txt-fixer - id: trailing-whitespace # ShellCheck hook for linting shell scripts - repo: https://github.com/shellcheck-py/shellcheck-py @@ -60,3 +52,9 @@ repos: rev: "v2.4.1" hooks: - id: codespell + # Markdownlint for linting Markdown files + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.18.1 + hooks: + - id: markdownlint-cli2 + args: [--fix]