You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit adaeded
Browse filesBrowse the repository at this point in the historyBrowse files
feat(release/auto-changelog): update release changelogs deterministically from a predecessor baseline
Replace update-release-changelog.sh with a TypeScript updater that builds the release section from the predecessor release's changelog plus the new PRs, keeps reviewer edits on an open changelog PR, and sends only new entries to the clean-room proofreader.
description: 'The GitHub repository containing the GitHub tools. Defaults to the GitHub tools action repositor, and usually does not need to be changed.'
53
-
required: false
54
-
default: ${{ github.action_repository }}
55
-
github-tools-ref:
56
-
description: 'The SHA of the action to use. Defaults to the current action ref, and usually does not need to be changed.'
Copy file name to clipboardExpand all lines: .github/actions/update-release-changelog/action.yml
+31-31Lines changed: 31 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -12,48 +12,42 @@ inputs:
12
12
repository-url:
13
13
required: true
14
14
description: 'Full HTTPS URL for the invoking repository.'
15
-
previous-version-ref:
16
-
required: false
17
-
default: 'null'
18
-
description: 'Previous release version reference (branch/tag/SHA). Use "null" for hotfixes.'
19
15
github-token:
20
16
required: true
21
17
description: 'GitHub token with write access to the invoking repository and read access to planning resources.'
22
-
github-tools-repository:
23
-
description: 'The GitHub repository containing the GitHub tools. Defaults to the GitHub tools action repositor, and usually does not need to be changed.'
24
-
required: false
25
-
default: ${{ github.action_repository }}
26
-
github-tools-ref:
27
-
description: 'The SHA of the action to use. Defaults to the current action ref, and usually does not need to be changed.'
# Generate the release test plan. The release-branch push workflow publishes
254
+
# the changelog separately so this script never races it for the same branch.
255
+
generate_release_test_plan() {
256
256
local platform="$1"
257
-
local new_version="$2"
258
-
local previous_version_ref="$3"
259
-
local release_branch_name="$4"
260
-
local changelog_branch_name="$5"
257
+
local previous_version_ref="$2"
258
+
local release_branch_name="$3"
261
259
262
260
# Skip commits.csv for hotfix releases (previous_version_ref is literal "null")
263
261
# - When we create a new major/minor release, we fetch all commits included in the release, by fetching the diff between HEAD and previous version reference.
264
262
# - When we create a new hotfix release, there are no commits included in the release by default (they will be cherry-picked one by one). So we don't have previous version reference, which is why the value is set to 'null'.
265
263
if [[ "${previous_version_ref,,}"=="null" ]];then
266
264
echo"Hotfix release detected (previous-version-ref is 'null'); skipping commits.csv generation."
267
265
else
268
-
# Need to run from .github-tools context to inherit it's dependencies/environment
266
+
# Generate the CSV with GitHub Tools' own dependencies, not the consumer's.
269
267
echo"Current Directory: $(pwd)"
270
268
PROJECT_GIT_DIR=$(pwd)
271
269
@@ -290,37 +288,18 @@ create_changelog_pr() {
290
288
echo"Previous version is not a recognized release branch pattern. Treating as tag or SHA: ${previous_version_ref}"
291
289
fi
292
290
293
-
# Switch to github-tools directory
294
-
cd./github-tools/
291
+
# Switch to the immutable action source directory.
292
+
cd"${GITHUB_TOOLS_DIR}"
295
293
ls -ltra
296
294
corepack prepare yarn@4.14.1 --activate
297
295
# This can't be done from the actions context layer due to the upstream repository having it's own context set with yarn
298
-
yarn --cwd install
296
+
yarn install
299
297
300
298
echo"Generating test plan csv.."
301
299
yarn run gen:commits "${platform}""${DIFF_BASE}""${release_branch_name}""${PROJECT_GIT_DIR}"
302
-
# Return to project root after generating commits.csv
303
-
cd../
300
+
# The action checkout is not nested under the consumer repository.
301
+
cd"${PROJECT_GIT_DIR}"
304
302
fi
305
-
306
-
# Delegate changelog update and PR creation to the shared update-release-changelog.sh script
307
-
echo"Updating changelog and creating PR.."
308
-
309
-
# Export git identity for the shared script
310
-
export GIT_AUTHOR_NAME="${GIT_USER_NAME}"
311
-
export GIT_AUTHOR_EMAIL="${GIT_USER_EMAIL}"
312
-
313
-
# Call the shared script
314
-
# The script is located in the same directory as this one
315
-
"${SCRIPT_DIR}/update-release-changelog.sh" \
316
-
"${release_branch_name}" \
317
-
"${platform}" \
318
-
"${GITHUB_REPOSITORY_URL}" \
319
-
"${previous_version_ref}" \
320
-
"${changelog_branch_name}" \
321
-
"${new_version}"
322
-
323
-
echo"Changelog PR Ready"
324
303
}
325
304
326
305
# Create version bump PR for main branch
@@ -339,7 +318,7 @@ create_version_bump_pr() {
339
318
340
319
# Update version files on main branch
341
320
echo"Running version update scripts for ${main_branch} branch.."
0 commit comments