Skip to content

Conversation

@Saga4
Copy link
Contributor

@Saga4 Saga4 commented Apr 10, 2025

ToDO: Currently there is no way to approve all workflow runs at once in GitHub Actions.

PR Type

  • Enhancement

Description

  • Improve workflow security check messaging.

  • Refactor PR author allowlist validation logic.

  • Standardize quoting in Git diff commands.

  • Enhance logging for workflow file changes.


Changes walkthrough 📝

Relevant files
Enhancement
8 files
codeflash-optimize.yaml
Update workflow validation and logging messages.                 
+15/-8   
end-to-end-test-bubblesort-pytest-no-git.yaml
Refactor workflow validation and allowlist checks.             
+15/-8   
end-to-end-test-bubblesort-unittest.yaml
Standardize security checks and log formatting.                   
+15/-8   
end-to-end-test-coverage.yaml
Improve PR validation for workflow changes.                           
+15/-8   
end-to-end-test-futurehouse.yaml
Enhance workflow security author-check messages.                 
+15/-8   
end-to-end-test-init-optim.yaml
Refactor validation and authorization messaging.                 
+15/-8   
end-to-end-test-tracer-replay.yaml
Harmonize workflow changes check and messages.                     
+15/-8   
end-to-end-topological-sort-test.yaml
Correct conditional logic and security output.                     
+15/-11 

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Failure
    @Saga4 Saga4 deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Active
    @Saga4 Saga4 temporarily deployed to external-trusted-contributors April 10, 2025 06:06 — with GitHub Actions Inactive
    @github-actions github-actions bot added workflow-modified This PR modifies GitHub Actions workflows Review effort 3/5 labels Apr 10, 2025
    @github-actions
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Duplication

    The allowlist and PR validation logic is now added in several workflow files with almost identical implementations. It is recommended to consider refactoring this repeated logic into a centralized or reusable component to ease future maintenance.

    # Check for any workflow changes
    if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q "^.github/workflows/"; then
      echo "⚠️ Workflow changes detected."
    
      # Get the PR author
      AUTHOR="${{ github.event.pull_request.user.login }}"
      echo "PR Author: $AUTHOR"
    
      # Allowlist check
      if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
        echo "✅ Authorized user ($AUTHOR). Proceeding."
      elif [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]]; then
        echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
      else
        echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
        exit 1
      fi
    else
      echo "✅ No workflow file changes detected. Proceeding."
    fi

    @github-actions
    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 06:12 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 06:21 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Failure
    @Saga4 Saga4 had a problem deploying to external-trusted-contributors April 10, 2025 15:30 — with GitHub Actions Error
    @Saga4 Saga4 merged commit 6b71c60 into main Apr 10, 2025
    8 of 16 checks passed
    KRRT7 pushed a commit that referenced this pull request Apr 14, 2025
    * fix PR approved state
    
    * fix topological sort wf
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    Review effort 3/5 workflow-modified This PR modifies GitHub Actions workflows

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants