Skip to content

Commit

Permalink
MRG: Merge pull request #82 from octue/enhancement/ignore-line-length…
Browse files Browse the repository at this point in the history
…-limit-for-merge-commits

Remove old scripts and ignore line length limit for merge commits
  • Loading branch information
cortadocodes authored Jun 28, 2023
2 parents 878ee40 + a35acb5 commit 63b90ee
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 1,545 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
with:
# Set fetch-depth to 0 to fetch all tags (necessary for git-mkver to determine the correct semantic version).
fetch-depth: 0
- uses: octue/[email protected]1
- uses: octue/[email protected]9
with:
version_source_type: setup.py
path: setup.py
breaking_change_indicated_by: minor

tests:
if: "!contains(github.event.head_commit.message, 'skipci')"
Expand Down
35 changes: 17 additions & 18 deletions .github/workflows/update-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# This workflow updates the pull request description with an auto-generated section containing the categorised commit
# message headers of the commits since the release. The auto generated section is enveloped between two comments:
# "<!---START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything outside these in the
# description is left untouched. Auto-generated updates can be skipped for future commits if
# message headers of the commits since the last pull request merged into main. The auto generated section is enveloped
# between two comments: "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything
# outside these in the description is left untouched. Auto-generated updates can be skipped for a commit if
# "<!--- SKIP AUTOGENERATED NOTES --->" is added to the pull request description.

name: update-pull-request

# Only trigger for pull requests into main branch.
on:
pull_request:
branches:
- main
on: pull_request

jobs:
description:
if: "!contains(github.event.pull_request.body, '<!--- SKIP AUTOGENERATED NOTES --->')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: octue/[email protected]
with:
pull_request_url: ${{ github.event.pull_request.url }}
api_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update pull request body
uses: riskledger/update-pr-description@v2
with:
body: ${{ env.PULL_REQUEST_DESCRIPTION }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Generate pull request description
uses: octue/[email protected]
id: pr-description
with:
pull_request_url: ${{ github.event.pull_request.url }}
api_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update pull request body
uses: riskledger/update-pr-description@v2
with:
body: ${{ steps.pr-description.outputs.pull_request_description }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:
- '^release/(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

- repo: https://github.com/octue/conventional-commits
rev: 0.7.1
rev: 0.8.2
hooks:
- id: check-commit-message-is-conventional
stages: [commit-msg]
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

# Continuous deployment via Conventional Commits

This package enables continuous deployment using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
via two GitHub actions and a `pre-commit` hook:
This repository contains three tools enabling continuous deployment using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) - two GitHub actions and a `pre-commit` hook:
- A [semantic version](https://semver.org/) checker that uses [`git-mkver`](https://github.com/idc101/git-mkver) to
predict what the version of the package should be as of the `HEAD` commit and checks if this matches the version as
currently stated in a `setup.py`, `setup.cfg`, `pyproject.toml`, or `package.json` file.
Expand Down
2 changes: 1 addition & 1 deletion conventional_commits/check_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _check_header(self, header):
f"{CODE_SEPARATOR!r}. Received {header!r}."
)

if len(header) > self.maximum_header_length:
if len(header) > self.maximum_header_length and not header.startswith("MRG"):
raise ValueError(
f"The commit header should be no longer than {self.maximum_header_length} characters; received "
f"{header!r}, which is {len(header)} characters long."
Expand Down
123 changes: 0 additions & 123 deletions conventional_commits/check_semantic_version.py

This file was deleted.

Loading

0 comments on commit 63b90ee

Please sign in to comment.