Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ jobs:
validateSingleCommit: ${{ inputs.validateSingleCommit }}

- name: 🏷️ Check PR labels
if: ${{ inputs.checkLabels && github.event.pull_request.head.repo.fork == false }}
if: ${{ inputs.checkLabels }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
labels=$(gh api repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/labels --jq '.[].name')

if [ -z "$labels" ]; then
if [ -z "$(gh api repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/labels --jq '.[].name')" ]; then
echo "::error::No labels found on this PR. Please add at least one label."
exit 1
else
echo "PR has labels"
echo "PR has labels, validation passed."
fi

validate-commits:
Expand All @@ -81,4 +79,4 @@ jobs:
uses: wagoid/commitlint-github-action@v6
with:
configFile: commitlint.config.cjs
...
...
Loading