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
22 changes: 22 additions & 0 deletions .github/workflows/conventional-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: conventional pull request title

on:
pull_request:
types: [opened, edited, reopened, ready_for_review]

permissions:
contents: read
Comment on lines +7 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

file=".github/workflows/conventional-title.yml"

if [ ! -f "$file" ]; then
  printf 'missing: %s\n' "$file"
  exit 0
fi

printf '%s\n' '--- workflow ---'
cat -n "$file"

printf '%s\n' '--- related token and permission references ---'
rg -n -i 'permissions|GITHUB_TOKEN|github\.event|pull_request|checkout|github api|curl|gh ' .github/workflows "$file" 2>/dev/null || true

printf '%s\n' '--- workflow files ---'
git ls-files '.github/workflows/*'

Repository: athal7/opencode-pilot

Length of output: 1864


Remove the unused contents permission.

This workflow only reads github.event.pull_request.title. Set workflow permissions to {}. Add a specific permission only if a later step requires it.

Proposed fix
 permissions:
-  contents: read
+  {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
permissions:
{}


jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Validate title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ "$TITLE" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([[:alnum:]_.\/-]+\))?!?:\ .+ ]]; then
exit 0
fi
printf 'Pull request titles must use Conventional Commits: %s\n' "$TITLE"
exit 1