Skip to content

Add containers realtime scan functionality and related constants #864

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

Closed
Closed
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
75 changes: 75 additions & 0 deletions .github/workflows/ast-cli-team-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: add-assignee-and-reviewers

on:
pull_request_target:
types: [ready_for_review, opened, reopened, review_requested, edited]

permissions:
contents: read
issues: write
pull-requests: read

jobs:
add-assignee-and-reviewers:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.type != 'Bot' }}
steps:
- name: Set up GitHub CLI
uses: cli/cli-action@v2
with:
version: latest

- name: Authenticate GitHub CLI
env:
GH_TOKEN: ${{ secrets.AST_CLI_GH_TOKEN }}
run: gh auth status

- name: Fetch team members
id: team
env:
GH_TOKEN: ${{ secrets.AST_CLI_GH_TOKEN }}
run: |
gh api orgs/CheckmarxDev/teams/ast-sypher-team/members --jq '.[].login' > team_members.txt
echo "✅ Team members:"
cat team_members.txt

- name: Fetch current reviewers
id: reviewers
env:
GH_TOKEN: ${{ secrets.AST_CLI_GH_TOKEN }}
run: |
gh pr view ${{ github.event.pull_request.number }} --json reviewRequests --jq '.reviewRequests' > all_reviewers.json

jq -r '.[] | select(.type == "User") | .login' all_reviewers.json > user_reviewers.txt
jq -r '.[] | select(.type == "Team") | .login' all_reviewers.json > team_reviewers.txt

echo "👤 User reviewers:"
cat user_reviewers.txt || echo "None"

echo "👥 Team reviewers:"
cat team_reviewers.txt || echo "None"

- name: Validate reviewers are only from ast-sypher-team
run: |
INVALID_USERS=()
while read reviewer; do
if ! grep -qx "$reviewer" team_members.txt; then
INVALID_USERS+=("$reviewer")
fi
done < user_reviewers.txt || true

INVALID_TEAMS=()
while read team; do
if [ "$team" != "ast-sypher-team" ]; then
INVALID_TEAMS+=("$team")
fi
done < team_reviewers.txt || true

if [ ${#INVALID_USERS[@]} -gt 0 ] || [ ${#INVALID_TEAMS[@]} -gt 0 ]; then
echo "❌ Invalid reviewers detected!"
echo "Invalid users: ${INVALID_USERS[*]}"
echo "Invalid teams: ${INVALID_TEAMS[*]}"
exit 1
fi

echo "✅ All reviewers are valid members of the ast-sypher-team or the team itself."
3 changes: 2 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# Each line is a file pattern followed by one or more owners

# Specify the default owners for the entire repository
* @AlvoBen @greensd4 @miryamfoiferCX
* @cx-anurag-dalke @cx-rah-pid

Loading
Loading