From a8ca20064faf18beb01e725f6a9d79622214c9b5 Mon Sep 17 00:00:00 2001 From: Kyle Harrison Date: Wed, 15 Nov 2023 12:13:52 +0000 Subject: [PATCH] ci: moves labels and commit linting to on-commit only (#9) --- .github/workflows/on-commit.yml | 37 +++++++++++++++++++++++++++ .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 44 --------------------------------- CONTRIBUTING.md | 2 +- 4 files changed, 39 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/on-commit.yml diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml new file mode 100644 index 0000000..232a01f --- /dev/null +++ b/.github/workflows/on-commit.yml @@ -0,0 +1,37 @@ +name: on-commit + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + lint-commit-messages: + name: lint commit message + runs-on: [ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install commitizen + run: | + python -m pip install commitizen + - name: Commitizen check + run: | + cz check --rev-range HEAD^! + + lint-pr-title: + # default: lints titles using https://github.com/commitizen/conventional-commit-types + name: lint pr title + runs-on: [ubuntu-latest] + permissions: + pull-requests: read + steps: + - uses: amannn/action-semantic-pull-request@v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa619e9..704f22d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: with: # https://github.com/google-github-actions/release-please-action#configuration release-type: python - package-name: poetry-plugin-upgrade + package-name: python-package-publish changelog-types: > [ {"type": "build", "section": "🏗️ Build System", "hidden": true}, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5419ecf..8228b80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,47 +43,3 @@ jobs: - name: Run ${{ matrix.tox.name }} in lint run: | python -m tox -e ${{ matrix.tox.environment }} - - apply-labels: - name: apply labels - permissions: - contents: read - pull-requests: write - runs-on: [ubuntu-latest] - steps: - - uses: actions/labeler@v4.3.0 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - sync-labels: true - - lint-commit-messages: - name: lint commit message - runs-on: [ubuntu-latest] - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - name: Install commitizen - run: | - python -m pip install commitizen - - name: Commitizen check - run: | - cz check --rev-range HEAD^! - - lint-pr-title: - # default: lints titles using https://github.com/commitizen/conventional-commit-types - name: lint pr title - runs-on: [ubuntu-latest] - permissions: - pull-requests: read - steps: - - uses: amannn/action-semantic-pull-request@v5.4.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9df6d0f..ba0aebb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ pytest tests Install current project from branch ```shell -poetry add git+https://github.com/MousaZeidBaker/poetry-plugin-up.git#branch-name +poetry add git+https://github.com/apoclyps/python-package-publish.git#branch-name ``` ## Commit message