Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr policy rules #146

Merged
merged 8 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
at par
Signed-off-by: mojafa <jmohsa@gmail.com>
mojafa committed Dec 22, 2024
commit c21b7a8b75d541b65556da95cbfd91aba49327aa
34 changes: 0 additions & 34 deletions .github/workflows/content-check.yml
Original file line number Diff line number Diff line change
@@ -18,40 +18,6 @@ jobs:
- name: Install dependencies
run: npm install

- name: Check for existing open PRs
id: check-prs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
contributor_login=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
new_pr_branch=$(jq -r '.pull_request.head.ref' "$GITHUB_EVENT_PATH")
echo "Contributor login: $contributor_login"
echo "New PR branch: $new_pr_branch"

# Fetch open PRs from the repository
open_prs=$(gh pr list --state open --json title,author,headRefName --jq '.[] | select(.author.login=="'"$contributor_login"'")')
echo "Open PRs by contributor: $open_prs"

matching_pr=$(echo "$open_prs" | jq -r 'select(.headRefName == "'"$new_pr_branch"'")')

if [ -z "$open_prs" ]; then
echo "::set-output name=has-open-prs::false"
elif [ -n "$matching_pr" ]; then
echo "New PR is related to an existing branch: $matching_pr"
echo "::set-output name=related-to-existing-pr::true"
else
echo "::set-output name=related-to-existing-pr::false"
echo "::set-output name=has-open-prs::true"
fi

- name: Comment and Fail If Contributor Has Unrelated Open PRs
if: steps.check-prs.outputs.has-open-prs == 'true' && steps.check-prs.outputs.related-to-existing-pr != 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "Hi @${{ github.event.pull_request.user.login }}, our policy allows contributors to work on one issue at a time. Please complete or close your existing pull requests before creating a new one. If this PR is related to an existing PR, please ensure it uses the same branch."
exit 1

- name: File Naming and Folder Structure Compliance
run: |
files_invalid=false
4 changes: 1 addition & 3 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,4 @@ Inc., except in the case of brief quotations embodied in critical reviews and
certain other noncommercial uses permitted by copyright law.

For permission requests, please contact Daytona Platforms Inc. at
support@daytona.io.

#test2
support@daytona.io.