Skip to content

build(deps): bump alpine from 3.21.3 to 3.22.1 in /base-images/src/alpine-base #6

build(deps): bump alpine from 3.21.3 to 3.22.1 in /base-images/src/alpine-base

build(deps): bump alpine from 3.21.3 to 3.22.1 in /base-images/src/alpine-base #6

Workflow file for this run

name: Generate Changelog for PR
on:
issue_comment:
types:
- created
permissions:
contents: read
jobs:
changelog:
name: Generate Changelog for PR
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: >
github.event.issue.pull_request &&
github.event.comment.body == '/changelog'
steps:
- name: Acknowledge request
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.issue.number }}
reactions: 'eyes'
comment-id: ${{ github.event.comment.id }}
- name: Verify OpenAI API Key is available
run: |
if [ -z "${OPENAI_API_KEY}" ]; then
echo "OPENAI_API_KEY is not set."
exit 1
fi
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Check if user has write access
id: check_access
uses: actions/[email protected]
with:
script: |
const { data: membership } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.payload.comment.user.login
});
if (membership.permission !== 'write' && membership.permission !== 'admin' && membership.permission !== 'maintain') {
core.setFailed(`User ${context.payload.comment.user.login} does not have write access.`);
} else {
core.setOutput("authorized", 'true');
}
- name: Generate Changelog Entry
if: steps.check_access.outputs.authorized == 'true'
id: changelog
uses: Automattic/vip-actions/ai-changelog@1ca5877971f93f05fceaa0efd119c40218c1da1e # trunk
with:
pr_number: ${{ github.event.issue.number }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
- name: Find Comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
if: steps.check_access.outputs.authorized == 'true'
id: fc
with:
issue-number: ${{ github.event.issue.number }}
comment-author: 'github-actions[bot]'
body-includes: '## AI-Generated Changelog Entry'
direction: last
- name: Post Changelog Comment
if: >
steps.check_access.outputs.authorized == 'true' &&
steps.changelog.outputs.changelog_entry
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.issue.number }}
body: |
## AI-Generated Changelog Entry
${{ steps.changelog.outputs.changelog_entry }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
- name: Set status (success)
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
if: success()
with:
issue-number: ${{ github.event.issue.number }}
reactions: 'hooray'
comment-id: ${{ github.event.comment.id }}
reactions-edit-mode: replace
- name: Set status (failure)
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
if: failure()
with:
issue-number: ${{ github.event.issue.number }}
reactions: '-1'
comment-id: ${{ github.event.comment.id }}
reactions-edit-mode: replace