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

Add Dynamic PR Comments with Build Status #465

Open
callogan opened this issue Feb 24, 2025 · 0 comments
Open

Add Dynamic PR Comments with Build Status #465

callogan opened this issue Feb 24, 2025 · 0 comments

Comments

@callogan
Copy link

Enhancement Proposal

Summary:
Improve the existing pull request comment workflow by adding dynamic comments that include the PR author and the current build status. This will enhance communication and provide real-time updates directly in the pull request.

Proposed Changes:

Modify the comment_contributing.yml workflow to post dynamic comments on PRs.
Comments will include:
The PR author (@username).
The current PR state (opened, closed, etc.).
A success/failure message based on the build result (if applicable).
Use GitHub API to post comments directly to the PR.
Benefits:

Clear and immediate feedback on the status of the pull request.
Improved team collaboration with automated status updates.
Reduces manual efforts to check build results and PR metadata.

Example Implementation:

jobs:
  comment-on-pr:
    uses: canonical/operator-workflows/.github/workflows/comment_contributing.yaml@main
    secrets: inherit
    steps:
      - name: Add dynamic PR comment with status
        run: |
          pr_url="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
          message="🚀 PR opened by @${{ github.actor }}. Current PR status: *${{ github.event.pull_request.state }}*."
          curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d "{\"body\":\"$message\"}" $pr_url

This improvement will make the workflow more interactive and valuable to contributors and reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant