fix(bug): some minor improvements

This commit is contained in:
Eshan Roy (Eshanized)
2024-05-11 01:11:36 +05:30
parent 1d040591a2
commit fe0bb7dc28
3 changed files with 61 additions and 20 deletions

33
.github/workflows/commitizen.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Commitizen Check on Push and Pull
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
commitizen_check:
name: Check Commitizen Commit on Push
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install Commitizen
run: npm install -g commitizen
- name: Verify Commitizen Commit
run: |
if git log --format='%s' ${{ github.event.before }}..${{ github.sha }} | grep -v '^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .+'; then
echo "Invalid commit message found. Please use Commitizen convention."
exit 1
fi

50
push.sh
View File

@@ -1,27 +1,35 @@
#!/bin/bash #!/bin/bash
# Author : Eshan Roy <eshan@snigdhaos.org> # Author : Eshanized <m.eshanized@gmail.com>
# Author URI : https://eshanized.github.io/ # Author URI : https://tonmoyinfrastructure.github.io/eshanized/
# NOTE: REPO = Your Repository Name On the Host ################################ NOTE ################################
# NOTE: ORG = Your ORGANIZATION NAME or USERNAME #!!!!!!!!!!!!! Exexcute all the scripts at your own risk !!!!!!!!!!!!!
# NOTE: HOST = GitHub, Gitlab, Bitbucket etc. # I have written the push script for Arch Linux and other Arch Based #
# Linux Distribution. So this script will only work in ArchLinux and #
# Arch based Linux Distribution. You may customize it according to #
# your Distribution. #
######################################################################
# Repo Config # ---> First We will check for commitizen is installed or not
REPO=snigdhaos-backgrounds check_commitizen() {
# Host Config if ! pacman -Qq commitizen-go &> /dev/null; then
HOST=https://github.com echo "Commitizen is not installed. Please install it using 'yay -S commitizen-go'." >&2
# Destination Config exit 1
ORG=Snigdha-OS fi
}
# Set the repository URL and branch # Function to stage, commit, and push changes
REPO_URL="${HOST}/${ORG}/${REPO}.git" push_to_github() {
BRANCH="master" # or "main" depending on your repository's default branch
# Commit message
MESSAGE="@eshanized: push via script"
# Add all files, commit, and push changes
git add . git add .
git commit -m "$MESSAGE" git cz
git push origin $BRANCH git push origin master
}
# Main Function
main() {
check_commitizen
push_to_github
}
main

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB