Skip to content

fix(ci): skip release-drafter job on pull_request events#157

Open
phmatray wants to merge 43 commits intomainfrom
fix/release-drafter-pr-trigger
Open

fix(ci): skip release-drafter job on pull_request events#157
phmatray wants to merge 43 commits intomainfrom
fix/release-drafter-pr-trigger

Conversation

@phmatray
Copy link
Contributor

@phmatray phmatray commented Mar 21, 2026

Problem

The Release Drafter workflow runs on both push (main) and pull_request events.

When triggered by a PR, the action attempts to update the draft release with the PR merge ref (refs/pull/N/merge) as target_commitish. The GitHub Releases API rejects this with:

Validation Failed: {"resource":"Release","code":"invalid","field":"target_commitish"}

This has caused 4+ recurring failures on every PR:

Fix

Added if: github.event_name == 'push' condition to the update_release_draft job.

Why this approach:

  • The pull_request trigger remains in the on: block — release-drafter uses it for the autolabeler feature (auto-labeling PRs based on changed files/title)
  • The job is skipped on PR events, so the draft release is only updated when commits land on main
  • No functionality is lost

What Changed

.github/workflows/release-drafter.yml — added one if: condition on the job.


Auto-fix PR updated by Ritchie (CTO) — automated CI health check 2026-03-26

dependabot bot and others added 30 commits January 10, 2025 05:43
Bumps [xunit](https://github.com/xunit/xunit) from 2.9.2 to 2.9.3.
- [Commits](xunit/xunit@v2-2.9.2...v2-2.9.3)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 6.0.3 to 6.0.4.
- [Release notes](https://github.com/coverlet-coverage/coverlet/releases)
- [Commits](coverlet-coverage/coverlet@v6.0.3...v6.0.4)

---
updated-dependencies:
- dependency-name: coverlet.collector
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 3.0.0 to 3.0.2.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](xunit/visualstudio.xunit@3.0.0...3.0.2)

---
updated-dependencies:
- dependency-name: xunit.runner.visualstudio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.12.0 to 17.13.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.12.0...v17.13.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [Microsoft.Extensions.DependencyInjection.Abstractions](https://github.com/dotnet/runtime) from 9.0.0 to 9.0.4.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](dotnet/runtime@v9.0.0...v9.0.4)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions
  dependency-version: 9.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Verified that DirectoryRenamed event invocation already correctly passes
the new path parameter. Code at VFS.Rename.cs line 96 matches the
VFSDirectoryRenamedArgs constructor signature perfectly.

Build verification: Succeeded with 0 errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…aths

Verified that redo logic at line 180 in ChangeHistory.cs is already correct:
- Uses directoryRenamed.Path (old path where directory is after undo)
- Uses directoryRenamed.NewName to rename forward
- This correctly recreates the original rename operation

Flow verification:
1. Original: /dir1 -> /dir2 (directory at /dir2)
2. Undo: Uses NewPath (/dir2) to rename to OldName -> directory at /dir1
3. Redo: Uses Path (/dir1) to rename to NewName -> directory back at /dir2

No code changes needed - implementation already correct.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…y nested structure

Added comprehensive test RenameDirectory_handles_deeply_nested_structure() that verifies:
- Creates deeply nested structure /a/b/c/d/e with files at each level
- Creates subdirectories at different levels
- Renames a middle directory and verifies all nested paths are updated correctly
- Verifies file contents are preserved
- Verifies file and directory Path properties are correctly updated
- Total of 11 RenameDirectory tests now passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Verification Results:
- 25 rename-specific tests: ALL PASSED
- Total test results: 379 passed, 4 pre-existing failures (locale-related)
- No regressions introduced by directory rename fix

The 4 failures are in VFSBinaryExtensionsTests (decimal separator formatting)
and are completely unrelated to the rename operation implementation.

All directory rename functionality verified:
✓ Basic rename operations
✓ Nested file path updates
✓ Deeply nested structures
✓ Event args with correct paths
✓ Undo/redo operations
✓ Edge case and error handling

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…a-requested)

Fixes:
- Add duplicate directory check in VFS.Rename.cs before rename operation
- Add test to verify exception is thrown when renaming to existing name

Verified:
- Validation follows same pattern as CreateDirectory duplicate check
- Test matches pattern from existing duplicate validation tests
- Fixes acceptance criteria #5: renaming to existing name throws exception

QA Fix Session: 1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes #130

The RenameDirectory method signature takes (VFSDirectoryPath, string),
not (VFSDirectoryPath, VFSDirectoryPath). Updated the demo to use the
correct method signature.

Changes:
- Uncommented the directory rename step
- Fixed second parameter to be a string ('heroes') instead of VFSDirectoryPath
- Removed TODO comment

Tests: All 379 unit tests + 71 GitHub tests pass on net10.0
* chore: standardize renovate config

* chore: fix renovate config for repo technologies
…on.abstractions to 10.0.4 (#150)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Resolve conflicts: keep dev Shouldly assertions, incorporate rename
validation fix and new test cases from branch.
Add contributors badge and CI badge to README.
…on.Abstractions-9.0.4' into dev

Keep 10.0.4 (already updated via Renovate), supersedes dependabot 9.0.4.
Keep dev's newer package versions (Test.Sdk 18.3.0, Shouldly, etc.).
phmatray and others added 10 commits March 10, 2026 23:52
Keep dev's newer coverlet.collector 8.0.0.
Keep dev's newer package versions.
Keep dev's generated CSS and .gitignore; incorporate WIP backup changes.
Keep dev versions for all conflicts; remove stale DemoCli csproj from stash.
The buildsphere package does not exist on NuGet, causing Renovate
package lookup failures (fixes #140).
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@phmatray phmatray force-pushed the fix/release-drafter-pr-trigger branch from da9f91b to e040752 Compare March 22, 2026 09:03
renovate bot added 2 commits March 23, 2026 09:23
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@phmatray phmatray force-pushed the fix/release-drafter-pr-trigger branch from e040752 to 213ea32 Compare March 23, 2026 09:01
The release-drafter action runs on both push (main) and pull_request
events. When triggered by a PR, it attempts to update the draft release
with the PR merge ref (refs/pull/N/merge) as target_commitish, which the
GitHub Releases API rejects with a 422 validation error.

Fix: add  condition to the job so the
draft release is only updated when commits land on main. The PR trigger
is still listed in the workflow triggers for the autolabeler feature —
it will simply be skipped at the job level.

Fixes recurring failures: runs 23481318939, 23369773059, 23369768998,
23111592904 (all 'invalid target_commitish' errors).
@phmatray phmatray force-pushed the fix/release-drafter-pr-trigger branch from 213ea32 to c0a3104 Compare March 26, 2026 09:01
@phmatray phmatray changed the title fix(ci): remove pull_request trigger from release-drafter workflow fix(ci): skip release-drafter job on pull_request events Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant