ci: update validate pr title to allow commitlint for non-forked repos #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Pull Request Checks" | |
on: | |
pull_request: | |
jobs: | |
## | |
# validation | |
## | |
validate_pr_title: | |
name: "Validate PR Title" | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- name: "🛎 Checkout" | |
uses: actions/checkout@v4 | |
- name: "🔧 Setup" | |
uses: ./.github/actions/use-dependencies | |
- name: "✅ Validate VIP Title" | |
if: ${{ github.event.pull_request.head.repo.fork == true }} | |
run: ./scripts/validate_pr_title.sh "${{ github.event.pull_request.title }}" | |
- name: "✅ Validate With Commitlint" | |
if: ${{ github.event.pull_request.head.repo.fork == false }} | |
run: echo ${{ github.event.pull_request.title }} | commitlint lint | |
## | |
# build | |
## | |
build: | |
name: "Build" | |
needs: [ validate_pr_title ] | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- name: "🛎 Checkout" | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: "🔧 Setup" | |
uses: ./.github/actions/use-dependencies | |
- name: "🏗️ Build" | |
env: | |
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache | |
HUGO_ENVIRONMENT: production | |
run: | | |
hugo \ | |
--gc \ | |
--minify |