aRustyDev / aRustyDev/helm-charts

enhancement: reuse changelog comment instead of creating new ones

Open
#48 0 comments 0 reactions 1 assignee Claimed by @aRustyDev View on GitHub
enhancement
Dominant language
Go Template
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

Currently, the W1 changelog job creates a new PR comment each time it runs. When a PR is updated and the workflow runs again, multiple "Changelog Preview" comments accumulate.

## Current Behavior

Each workflow run creates a new comment, leading to multiple changelog comments on the same PR.

## Desired Behavior

- Find existing "Changelog Preview" comment if it exists
- Update the existing comment with new changelog content
- Only create a new comment if none exists

## Implementation Notes

The `peter-evans/create-or-update-comment@v4` action supports this via:
```yaml
- uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: changelog.md
edit-mode: replace
```

Would need to add a step to find existing comment:
```yaml
- uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "# Changelog Preview"
```

## Acceptance Criteria

- [ ] Single changelog comment per PR
- [ ] Comment is updated on subsequent workflow runs
- [ ] Original comment timestamp preserved (updated timestamp shown)

## References

- Workflow: `.github/workflows/validate-contribution.yaml` (changelog job)
- Action docs: https://github.com/peter-evans/create-or-update-comment

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.