Skip to content

Commit

Permalink
📝 docs(ci): Add README to .github/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Sep 14, 2023
1 parent 0a640ea commit 3dea914
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -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/) specifications.
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ 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:
GITMOJI_CONFIG_PACKAGE: "commitlint-config-gitmoji"
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
run: |
echo "${{ github.event.pull_request.title }}" | pnpm -s dlx commitlint

0 comments on commit 3dea914

Please sign in to comment.