From 5e274f4f1cfae122340a4cdeaa6bd05bb91da733 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 19:12:15 +0600 Subject: [PATCH 01/10] Make pre-commit run with GitHub Actions #13 --- .github/workflows/pre-commit.yml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..17aa881 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,35 @@ +--- + name: Pre-commit + + on: [push, pull_request] + + jobs: + pre-commit: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.13' # Specify your Python version + + - name: Set Python Version Hash + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + + - name: Cache pre-commit + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Install pre-commit + run: | + python -m pip install --upgrade pip + pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files + \ No newline at end of file From 26f1113bff35e6814c95bb79c9d0f8e52c682a28 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 20:16:18 +0600 Subject: [PATCH 02/10] Broken pull request labeler #28 --- .github/labeler.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index afeb6df..69a439f 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,5 +1,8 @@ --- documentation: - - "**/*.md" - - "README.md" - - "docs/**" + - pattern: "**/*.md" + label: documentation + - pattern: "README.md" + label: documentation + - pattern: "docs/**" + label: documentation From 9620b764e9981f6888e8ba9093ab7ee166cfe2a8 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 20:29:58 +0600 Subject: [PATCH 03/10] Broken pull request labeler #28 --- .github/labeler.yml | 24 ++++++++++++++++++------ .github/workflows/labeler.yml | 29 ++++++++++++++++------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 69a439f..1881d44 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,8 +1,20 @@ --- documentation: - - pattern: "**/*.md" - label: documentation - - pattern: "README.md" - label: documentation - - pattern: "docs/**" - label: documentation + - "**/*.md" + - "README.md" + - "docs/**" + +examples: + - "examples/**/*" + +github: + - ".github/**/*" + +source-code: + - "**/*.c" + +scripts: + - "**/*.sh" + +repo: + - "*" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7a5234c..9f02a74 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,17 +1,20 @@ --- -name: "Pull Request Labeler" + name: "Pull Request Labeler" -on: - pull_request: - types: [opened, synchronize] + on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] -jobs: - label: - runs-on: ubuntu-latest + jobs: + label: + runs-on: ubuntu-latest - steps: - - name: Pull Request Labeler - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: ".github/labeler.yml" + steps: + - name: Pull Request Labeler + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: ".github/labeler.yml" From 4eb32393588968781a87869f19f800907d5eb5f9 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 20:34:18 +0600 Subject: [PATCH 04/10] Broken pull request labeler #28 --- .github/labeler.yml | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 1881d44..bd80bb3 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,20 +1,40 @@ --- documentation: - - "**/*.md" - - "README.md" - - "docs/**" + - any: + - changed-files: + - any-glob-to-any-file: + - "**/*.md" + - any-glob-to-any-file: + - "README.md" + - any-glob-to-any-file: + - "docs/**" examples: - - "examples/**/*" + - any: + - changed-files: + - any-glob-to-any-file: + - "examples/**/*" github: - - ".github/**/*" + - any: + - changed-files: + - any-glob-to-any-file: + - ".github/**/*" source-code: - - "**/*.c" + - any: + - changed-files: + - any-glob-to-any-file: + - "**/*.c" scripts: - - "**/*.sh" + - any: + - changed-files: + - any-glob-to-any-file: + - "**/*.sh" repo: - - "*" + - any: + - changed-files: + - any-glob-to-any-file: + - "*" From 0ff94e0a6fd6ebfbbf0ef0cfdf9bd4110b1b0569 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 20:39:20 +0600 Subject: [PATCH 05/10] Broken pull request labeler #28 --- .github/workflows/labeler.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 9f02a74..564fd01 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,15 +2,15 @@ name: "Pull Request Labeler" on: - push: - branches: - - main pull_request: types: [opened, synchronize] + push: # Include the push event jobs: label: runs-on: ubuntu-latest + permissions: # Grant permissions to the action + pull-requests: write # Allow write access to PRs steps: - name: Pull Request Labeler From 968e70fde24e5241a0725b28176a10ac11cdf261 Mon Sep 17 00:00:00 2001 From: SM Riad Date: Sun, 27 Oct 2024 20:42:06 +0600 Subject: [PATCH 06/10] Broken pull request labeler #28 --- .github/workflows/labeler.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 564fd01..6aed6d1 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,15 +2,15 @@ name: "Pull Request Labeler" on: - pull_request: + pull_request_target: # Change from pull_request to pull_request_target types: [opened, synchronize] - push: # Include the push event + push: # Keep the push event jobs: label: runs-on: ubuntu-latest - permissions: # Grant permissions to the action - pull-requests: write # Allow write access to PRs + permissions: + pull-requests: write # Ensure write access for PRs steps: - name: Pull Request Labeler From d6aac9da06eb128c7ca0b24e61206952d1d43b79 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 29 Oct 2024 17:13:06 +1000 Subject: [PATCH 07/10] Update .github/labeler.yml --- .github/labeler.yml | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index bd80bb3..047ea1a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,38 +3,16 @@ documentation: - any: - changed-files: - any-glob-to-any-file: - - "**/*.md" - - any-glob-to-any-file: - - "README.md" - - any-glob-to-any-file: - - "docs/**" - -examples: - - any: - - changed-files: - - any-glob-to-any-file: - - "examples/**/*" - -github: - - any: - - changed-files: - - any-glob-to-any-file: - - ".github/**/*" - -source-code: - - any: - - changed-files: - - any-glob-to-any-file: - - "**/*.c" + - **/*.md -scripts: +root: - any: - changed-files: - any-glob-to-any-file: - - "**/*.sh" + - '*' -repo: +github-actions: - any: - changed-files: - any-glob-to-any-file: - - "*" + - .github/**/* From fabf6a816e93849b94057061dc14b3e9dff5b40e Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 29 Oct 2024 17:15:03 +1000 Subject: [PATCH 08/10] Update .github/labeler.yml --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 047ea1a..87040ea 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,7 +3,7 @@ documentation: - any: - changed-files: - any-glob-to-any-file: - - **/*.md + - '**/*.md' root: - any: From b87c36ecbf98566cfd25cd23015ac8e9225a3ab3 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 29 Oct 2024 17:16:20 +1000 Subject: [PATCH 09/10] Update .github/workflows/labeler.yml --- .github/workflows/labeler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6aed6d1..c6ddfc3 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,3 +18,4 @@ with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: ".github/labeler.yml" + sync-labels: true From 0c41df16821463d85d7f29effb331f70d78366d8 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 29 Oct 2024 17:19:53 +1000 Subject: [PATCH 10/10] Update .github/workflows/labeler.yml --- .github/workflows/labeler.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c6ddfc3..77164b8 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,9 +2,7 @@ name: "Pull Request Labeler" on: - pull_request_target: # Change from pull_request to pull_request_target - types: [opened, synchronize] - push: # Keep the push event + - pull_request_target jobs: label: