Skip to content

Commit 41440f0

Browse files
committed
gitdir
1 parent 55cb1da commit 41440f0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/scripts/create-platform-release-pr.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ npx @metamask/auto-changelog@4.1.0 update --rc --repo "${GITHUB_REPOSITORY_URL}"
143143

144144
# Need to run from .github-tools context to inherit it's dependencies/environment
145145
echo "Current Directory: $(pwd)"
146+
PROJECT_GIT_DIR=$(pwd)
146147
ls -ltra
147148
cd ./github-tools/
148149
ls -ltra
149150
corepack prepare yarn@4.5.1 --activate
150151
# This can't be done from the actions context layer due to the upstream repository having it's own context set with yarn
151152
yarn --cwd install
152153
echo "Generating test plan csv.."
153-
yarn run gen:commits "${PLATFORM}" "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}"
154+
yarn run gen:commits "${PLATFORM}" "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}" "${PROJECT_GIT_DIR}"
154155
cd ../
155156

156157
echo "Adding and committing changes.."

.github/scripts/generate-rc-commits.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ if (response.status !== 200 || !response.data ) {
5959
// Function to filter commits based on unique commit messages and group by teams
6060
async function filterCommitsByTeam(platform, branchA, branchB) {
6161

62+
console.log('Filtering commits by team...');
63+
6264
var repository = '';
6365

6466
switch (platform) {
@@ -168,7 +170,7 @@ async function main() {
168170
const args = process.argv.slice(2);
169171
const fileTitle = 'commits.csv';
170172

171-
if (args.length !== 3) {
173+
if (args.length !== 4) {
172174
console.error('Usage: node generate-rc-commits.mjs platform branchA branchB');
173175
console.error('Received:', args, ' with length:', args.length);
174176
process.exit(1);
@@ -177,6 +179,11 @@ async function main() {
177179
const platform = args[0];
178180
const branchA = args[1];
179181
const branchB = args[2];
182+
const gitDir = args[3];
183+
184+
// Change the working directory to the git repository path
185+
// Since this is invoked by a shared workflow, the working directory is not guaranteed to be the repository root
186+
process.chdir(gitDir);
180187

181188
console.log(`Generating CSV file for commits between ${branchA} and ${branchB} on ${platform} platform...`);
182189

0 commit comments

Comments
 (0)