Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions .github/workflows/assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto Assign Pull Request

on:
pull_request:
types: [ opened ]

permissions:
pull-requests: write

jobs:
assign:
name: Auto Assign Pull Request
runs-on: ubuntu-latest
steps:
- name: Auto Assign Pull Request
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const assignee = "QingFeng-awa";
const issue_number = context.payload.pull_request.number;

await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
assignees: [assignee]
});
2 changes: 1 addition & 1 deletion .github/workflows/buildTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build Test

on:
pull_request:
types: [ ready_for_review, synchronize, review_requested ]
types: [ opened, synchronize ]

permissions:
contents: read
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/ignoreCheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Check Gitignored Files

on:
pull_request:
types: [ opened, synchronize ]

jobs:
check-gitignored:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get PR base branch
id: base-branch
run: |
echo "branch=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT

- name: Check for gitignored files in PR
run: |
# Get the list of changed files between base branch and PR head
git fetch origin ${{ steps.base-branch.outputs.branch }}

# Get all changed files (added, modified) in the PR
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ steps.base-branch.outputs.branch }}...HEAD)

if [ -z "$CHANGED_FILES" ]; then
echo "No files changed in this PR"
exit 0
fi

echo "Changed files:"
echo "$CHANGED_FILES"
echo ""

# Check if .gitignore exists
if [ ! -f .gitignore ]; then
echo "✅ No .gitignore file found, nothing to check"
exit 0
fi

# Store violated files
VIOLATED_FILES=""

# Check each changed file against gitignore patterns
while IFS= read -r file; do
# Use git check-ignore to verify if file would be ignored
# Note: we use -v for verbose, and check if it returns 0 (means ignored)
if git check-ignore -q "$file" 2>/dev/null; then
VIOLATED_FILES="${VIOLATED_FILES}\n - $file"
fi
done <<< "$CHANGED_FILES"

# Report results
if [ -n "$VIOLATED_FILES" ]; then
echo "❌ ERROR: The following files are ignored by .gitignore but were included in this PR:"
echo -e "$VIOLATED_FILES"
exit 1
else
echo "✅ No gitignored files found in this PR"
fi
Loading
Loading