Skip to content

Commit

Permalink
ci: moves labels and commit linting to on-commit only (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoclyps authored Nov 15, 2023
1 parent 775ad3d commit a8ca200
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 46 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/on-commit.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8ca200

Please sign in to comment.