Comments (6)
I did a little research on this today and discovered that a very similar action already exists!
https://github.com/amannn/action-semantic-pull-request
@amannn and @hanno-jonlay I see you've contributed to that project. Would you be okay with me updating the REAMDE of this project to mention your Action as an alternative?
from semantic-pull-requests.
I was unhappy with the pre-existing GitHub Actions( weird emoji support) and I looked a bit into this. I ended up just using an if
on the PR title. It's not pretty, but it works.
As it'll be a while until I open-source the project using these actions, here's the relevant code:
name: Conformance
on:
pull_request:
types: [opened, synchronize, edited]
...
steps:
- name: PR title is valid
if: >
startsWith(github.event.pull_request.title, '📦 ') ||
startsWith(github.event.pull_request.title, '🐛 ') ||
startsWith(github.event.pull_request.title, '👌 ') ||
startsWith(github.event.pull_request.title, '🚀 ') ||
startsWith(github.event.pull_request.title, '‼️ ') ||
startsWith(github.event.pull_request.title, '⬆️ ')
run: |
echo 'Title checks passed'
- name: PR title is invalid
if: >
!startsWith(github.event.pull_request.title, '📦 ') &&
!startsWith(github.event.pull_request.title, '🐛 ') &&
!startsWith(github.event.pull_request.title, '👌 ') &&
!startsWith(github.event.pull_request.title, '🚀 ') &&
!startsWith(github.event.pull_request.title, '‼️ ') &&
!startsWith(github.event.pull_request.title, '⬆️ ')
run: |
echo 'Pull request title is not valid. See .github/PULL_REQUEST_TEMPLATE/pull_request_template.md for details'
exit 1
At one point I was even commenting back on the PR for more visibility, but I thought that was a bit much:
- name: Comment for PR title conformance
if: failure()
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{tojson(github.event.number)}}
body: |
Please ensure your PR title starts with an icon:
📦 New things / new features / new docs
🐛 Fix existing thing / bug fixes
👌 Improve something / refactor
🚀 Release / ship / deploy
‼️ Breaking changes / user involvement requires / manual delivery steps
⬆️ Dependency updates / tooling bumps
PR titles should be, in order of importance:
- imperative( _add_ instead of _added_)
- explicit
- short
Examples of PR titles:
📦 Add yaml support
📦 Add Firefox browser tests
📦 Tutorial for API Interface
📦 ADR: Use Terraform for IaC
📦 Add automated CHANGELOG
🐛 Fix conversion failure for Italian
🐛 Stop panic on baldy formatted input
👌 Improve handling of JPEG files
👌 Link to PRs in CHANGELOG
👌 Refactor event routing
‼️ Change API response codes
⬆️ Bump json from v5 to v6
from semantic-pull-requests.
Side note: I see this in the README
Note that since PR titles only have a single line, you have to use the
!
syntax for breaking changes.
Does semantic-release already support that as an alternative to BREAKING CHANGE:
in the commit body? If so, that's very exciting news.
from semantic-pull-requests.
Not sure I can say much here, since my contribution was amusingly tiny: amannn/action-semantic-pull-request@08fc3f6
Fun to hear you mention this, however, as I spent a bit of time considering your app before we eventually settled on @amannn's action instead. So I think that for other newbies, a comment in the README would have been useful.
from semantic-pull-requests.
Would you be okay with me updating the REAMDE of this project to mention your Action as an alternative?
Of course! 🙂
Does semantic-release already support that as an alternative to BREAKING CHANGE: in the commit body? If so, that's very exciting news.
Yep, it does! While I was working on the action I've found that commit-analyzer
didn't support this back then, but that was quickly resolved then! I never had any issues so far.
from semantic-pull-requests.
FWIW, an app works out much better for multiple projects. It's faster than GH actions, doesn't eat up actions runtime quota, easier to configure and so on. There's more you can do with GH actions but doing so again and again across projects becomes tedious after a while.
from semantic-pull-requests.
Related Issues (20)
- Looking for maintainer(s) HOT 2
- Github IP allow list HOT 2
- Github Enterprise (GHE) App deployed successfully, but no status checks shown on PR HOT 5
- Feature request: support for fixup! (git commit --fixup) commits HOT 1
- Is semantic-pull-requests service down? HOT 15
- Opt-in check only by adding a configuration HOT 5
- Is it a issue? When there is no space after colon, PR is invalid HOT 2
- semantic PR check still not working HOT 24
- Semantic Pull Request test Fail ❌ HOT 1
- Node engine version HOT 10
- Semantic bot not working, no semantic entry in checks HOT 2
- feature: support optional scope in type HOT 4
- Add gitmoji acceptance HOT 1
- Service down HOT 24
- Github defaults to PR title for squash and merge HOT 1
- App stops working in aws/aws-sdk-js-v3 HOT 2
- Maintenance mode - Thanks! HOT 1
- It can use this flow with Gitlab? HOT 2
- Status check stuck in "Expected — Waiting for status to be reported" state HOT 1
- Stuck waiting for Semantic Pull Request status to be reported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semantic-pull-requests.