From c361dd6316ee5b4166b6295a6a4b6e3e847ae924 Mon Sep 17 00:00:00 2001 From: Tushar Bansal Date: Mon, 1 Apr 2024 15:02:51 +0530 Subject: [PATCH] fix: workflow (#12) * fix: commit workflow * chore : remove labeller * fix: workflow test --- .github/labeler.yml | 22 ---------------------- .github/workflows/commit_rules.yml | 28 +++++++++++++++------------- .github/workflows/dev_test.yml | 4 ++-- .github/workflows/docker_build.yml | 2 +- 4 files changed, 18 insertions(+), 38 deletions(-) delete mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 4613569..0000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler - -name: Labeler -on: [pull_request_target] - -jobs: - label: - - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/commit_rules.yml b/.github/workflows/commit_rules.yml index 51b0cde..5ccdbcc 100644 --- a/.github/workflows/commit_rules.yml +++ b/.github/workflows/commit_rules.yml @@ -1,15 +1,17 @@ -rules: - - name: "Commit message length" - description: "Ensure commit messages are not too long" - pattern: ".{1,50}" - error_message: "Commit messages should be between 1 and 50 characters long" +name: Conventional Commits - - name: "Capitalized subject" - description: "Ensure commit message subject starts with a capital letter" - pattern: "^[A-Z].*" - error_message: "Commit message subject should start with a capital letter" +on: + pull_request: + branches: [ main ] - - name: "Imperative mood" - description: "Ensure commit message subject is in imperative mood" - pattern: "(^fix|^update|^add|^remove|^refactor|^implement|^merge|^resolve|^enhance|^correct|^optimize|^adjust|^improve|^change|^test|^doc|^style|^clean)(s|es|ed|ing)?\\b" - error_message: "Commit message subject should use imperative mood" +jobs: + build: + name: Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: webiny/action-conventional-commits@v1.3.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Optional, for private repositories. + allowed-commit-types: "feat,fix" # Optional, set if you want a subset of commit types to be allowed. \ No newline at end of file diff --git a/.github/workflows/dev_test.yml b/.github/workflows/dev_test.yml index 9669c48..0ec11cd 100644 --- a/.github/workflows/dev_test.yml +++ b/.github/workflows/dev_test.yml @@ -3,10 +3,10 @@ name: Run Tests and Create .env.development on: push: branches: - - dev + - main pull_request: branches: - - dev + - main jobs: test: diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 7e34d5b..c505576 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -3,7 +3,7 @@ name: Update docker dev image on: push: branches: - - dev + - main jobs: build-and-push: