summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/darker-lint.yml20
1 files changed, 19 insertions, 1 deletions
diff --git a/.github/workflows/darker-lint.yml b/.github/workflows/darker-lint.yml
index b2d5d9d..4e26d45 100644
--- a/.github/workflows/darker-lint.yml
+++ b/.github/workflows/darker-lint.yml
@@ -14,10 +14,28 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-python@v5
+
+ - name: Get head commit ID
+ id: get-head-commit
+ run: |
+ HEAD_COMMIT=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH")
+ echo "head_commit=$HEAD_COMMIT" >> "$GITHUB_OUTPUT"
+
+ - name: Get base commit ID
+ id: get-base-commit
+ run: |
+ BASE_COMMIT=$(jq -r .pull_request.base.sha "$GITHUB_EVENT_PATH")
+ echo "base_commit=$BASE_COMMIT" >> "$GITHUB_OUTPUT"
+
+ - name: Use commit IDs
+ run: |
+ echo "Head commit ID: ${{ steps.get-head-commit.outputs.head_commit }}"
+ echo "Base commit ID: ${{ steps.get-base-commit.outputs.base_commit }}"
+
- uses: akaihola/darker@v2.1.1
with:
options: "--check --diff --isort --color"
src: "."
version: "~=2.1.1"
lint: "flake8,pylint==2.13.1"
- revision: "current...HEAD"
+ revision: "${{ steps.get-base-commit.outputs.base_commit }}...${{ steps.get-head-commit.outputs.head_commit }}"