diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 000000000..0817cefe1 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,7 @@ +# .github/workflows + +CI Workflows + +## [🦄 pr.yml](pr.yml) + +Runs on every pull request and validates whether the PR titles follow the [Gitmoji](https://gitmoji.dev/specification) and [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) specifications. diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 003628400..12536897e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,6 +15,7 @@ jobs: with: version: 8.7.5 + # Fetches the config package version from the `pnpm-lock.yaml` file. - name: Fetch config package version id: config-package-version env: @@ -22,12 +23,14 @@ jobs: run: | echo "CONFIG_PACKAGE=$(grep -A 2 "$GITMOJI_CONFIG_PACKAGE" pnpm-lock.yaml | awk '/version:/ {print "'"$GITMOJI_CONFIG_PACKAGE"'@" $2}')" >> "$GITHUB_OUTPUT" + # Installs only the config package required for commitlint. - name: Install config package env: CONFIG_PACKAGE: "${{ steps.config-package-version.outputs.CONFIG_PACKAGE }}" run: | pnpm add "$CONFIG_PACKAGE" + # The validation is done based on the `commitlint.config.js` file. - name: Validate PR title env: # Sanitizes PR title as documented here: