Skip to content

Commit 6ff20fa

Browse files
Copilotintel352
andcommitted
Fix go.sum handling to avoid errors when file isn't modified
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
1 parent b3fd974 commit 6ff20fa

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/module-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ jobs:
318318
# Commit the change
319319
git config user.name 'github-actions[bot]'
320320
git config user.email 'github-actions[bot]@users.noreply.github.com'
321-
git add "modules/${MODULE}/go.mod" "modules/${MODULE}/go.sum"
321+
git add "modules/${MODULE}/go.mod"
322+
# Add go.sum if it was modified
323+
git add "modules/${MODULE}/go.sum" 2>/dev/null || true
322324
git commit -m "chore(${MODULE}): update module path for v${MAJOR_VERSION}
323325
324326
This updates the ${MODULE} module path from:

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ jobs:
266266
# Commit the change
267267
git config user.name 'github-actions[bot]'
268268
git config user.email 'github-actions[bot]@users.noreply.github.com'
269-
git add go.mod go.sum
269+
git add go.mod
270+
# Add go.sum if it was modified
271+
git add go.sum 2>/dev/null || true
270272
git commit -m "chore: update module path for v${MAJOR_VERSION}
271273
272274
This updates the module path from:

0 commit comments

Comments
 (0)