Skip to content

Commit 324ce51

Browse files
authored
feat: improve release audit summaries (#161)
* feat: improve release preparation audit summary * feat: summarize changelog history propagation * fix: pass audit values through environment
1 parent f23b180 commit 324ce51

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

‎actions/release-post-merge/action.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ runs:
173173
prepared_id="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["id"];' "${RELEASE_STATE_DIR}/prepared-release.json")"
174174
echo "prepared-release-id=${prepared_id}" >> "${GITHUB_OUTPUT}"
175175
176+
{
177+
echo "## History synchronization"
178+
echo
179+
php -r '
180+
$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR);
181+
$items=$p["history_synchronizations"] ?? [$p["history_synchronization"]];
182+
foreach ($items as $item) {
183+
$branch=$item["target_branch"];
184+
$state=$item["state"];
185+
$pr=$item["pull_request"] ?? null;
186+
if (is_array($pr) && isset($pr["url"], $pr["number"])) {
187+
printf("- `%s`: **%s** — [#%d](%s)\n", $branch, $state, $pr["number"], $pr["url"]);
188+
} else {
189+
printf("- `%s`: **%s**\n", $branch, $state);
190+
}
191+
}
192+
' "${RELEASE_STATE_DIR}/prepared-release.json"
193+
} >> "${GITHUB_STEP_SUMMARY}"
194+
176195
- id: milestone
177196
name: Apply milestone transition
178197
shell: bash

‎actions/release-prepare/action.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ runs:
164164
RELEASE_TOOL_PATH: ${{ steps.plan.outputs.tool-path }}
165165
RELEASE_PLAN_PATH: ${{ steps.plan.outputs.plan-path }}
166166
RELEASE_CONFIG_PATH: ${{ inputs.config-path }}
167+
RELEASE_REQUESTED_BY: ${{ inputs.actor }}
168+
RELEASE_TOOL_VERSION: ${{ steps.plan.outputs.tool-version }}
167169
run: |
168170
set -euo pipefail
169171
state_dir="${RUNNER_TEMP}/release-preparation-state"
@@ -189,10 +191,22 @@ runs:
189191
echo "artifact-name=${artifact_name}" >> "${GITHUB_OUTPUT}"
190192
echo "state-dir=${state_dir}" >> "${GITHUB_OUTPUT}"
191193
194+
plan_id="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["id"];' "${RELEASE_PLAN_PATH}")"
195+
release_branch="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["branch"];' "${RELEASE_PLAN_PATH}")"
196+
planning_base="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["planning_base_sha"];' "${RELEASE_PLAN_PATH}")"
197+
release_version="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["proposed_version"];' "${RELEASE_PLAN_PATH}")"
198+
release_channel="$(php -r '$p=json_decode(file_get_contents($argv[1]),true,512,JSON_THROW_ON_ERROR); echo $p["channel"];' "${RELEASE_PLAN_PATH}")"
199+
192200
{
193201
echo "## Release preparation"
194202
echo
195-
printf -- '- Preparation: `%s`\n' "${preparation_id}"
203+
printf -- '- Requested by: `%s`\n' "${RELEASE_REQUESTED_BY}"
204+
printf -- '- Branch: `%s`\n' "${release_branch}"
205+
printf -- '- Planning base: `%s`\n' "${planning_base}"
206+
printf -- '- Version: `%s` (%s)\n' "${release_version}" "${release_channel}"
207+
printf -- '- release-tool: `%s`\n' "${RELEASE_TOOL_VERSION}"
208+
printf -- '- ReleasePlan: `%s`\n' "${plan_id}"
209+
printf -- '- ReleasePreparation: `%s`\n' "${preparation_id}"
196210
echo "- Pull request: ${pr_url}"
197211
printf -- '- State artifact: `%s`\n' "${artifact_name}"
198212
} >> "${GITHUB_STEP_SUMMARY}"

0 commit comments

Comments
 (0)