Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/oci-image-bump-pr-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"oci-image-bump": minor
---

Add a `pr-body` input to set the pull request body. Callers that do not set it keep the default body.
18 changes: 18 additions & 0 deletions actions/oci-image-bump/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ inputs:
pr-title:
description: "Title of the PR."
required: true
pr-body:
description: |
Body of the PR.

Leave empty to use the create-pull-request default body.
required: false

outputs:
pr-number:
Expand Down Expand Up @@ -163,6 +169,17 @@ runs:
exit 1
fi

# Writes the body to a file. An empty input keeps the action default body.
- name: Resolve PR body
id: pr-body
if: inputs.pr-body != ''
shell: bash
env:
PR_BODY: ${{ inputs.pr-body }}
run: |
printf '%s' "$PR_BODY" > "${RUNNER_TEMP}/pr-body.md"
echo "body-path=${RUNNER_TEMP}/pr-body.md" | tee -a "$GITHUB_OUTPUT"

# Commits, creates/pushes branch, and creates the PR.
- name: Create PR
id: create-pr
Expand All @@ -174,6 +191,7 @@ runs:
labels: ${{ inputs.pr-labels }}
sign-commits: true
title: ${{ inputs.pr-title }}
body-path: ${{ steps.pr-body.outputs.body-path }}
Comment thread
chainchad marked this conversation as resolved.
token: ${{ inputs.github-token }}

- name: Add PR to Summary
Expand Down
Loading