Skip to content

ci: unblock releases and skip the sonar scan on dependabot pull requests - #12948

Merged
alumni merged 3 commits into
masterfrom
fix/release-and-dependabot-ci
Oct 9, 2026
Merged

alumni merged 3 commits into
masterfrom
fix/release-and-dependabot-ci

Conversation

@michaelbromley

@michaelbromley michaelbromley commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Fixes the two failures hit while releasing 1.1.2.

Sonar on Dependabot pull requests

The scan steps were guarded against forks only:

github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

Dependabot pushes its branches to this repository rather than a fork, so the guard passes. A Dependabot pull_request run reads from a separate secrets store, and the repository has no Dependabot secrets, so SONAR_TOKEN arrives empty. From run 37728614352, the first attempt on a Dependabot pull request:

SONAR_TOKEN:
##[warning]Running this GitHub Action without SONAR_TOKEN is not recommended
Not authorized. Please check the 'sonar.token' property or the 'SONAR_TOKEN' environment variable

The guard now skips Dependabot as well. The alternative is adding SONAR_TOKEN to the Dependabot secrets store, which would expose the token to runs built from dependency updates.

The codemod blocking releases

The 1.1.2 release published typeorm, then failed on Publish @typeorm/codemod with ENEEDAUTH. That is a credentials error: the codemod had no trusted publisher on npm, while typeorm did. A trusted publisher has since been configured on npmjs.com against typeorm/typeorm, workflow publish-package.yml, environment npm.

With credentials working, that release would now fail on the version number instead. The codemod is versioned independently of typeorm and usually does not change between releases. A release that leaves its version alone therefore tries to publish a version already on the registry, and does so after typeorm has gone out.

This change skips the publish when the version is already on the registry. The lookup asks registry.npmjs.org directly rather than going through pnpm view, and any status other than 200 or 404 fails the step.

Against the live registry, 1.0.3 returns 200 and skips, while 1.0.4 and a dated nightly version return 404 and publish. A release leaves an unchanged codemod alone, and a nightly still publishes because it stamps a fresh version.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Three scan guards repeat the same note ✓ Resolved
Description
The two-line comment about SONAR_TOKEN is copied verbatim above all three Sonar scan guards.
Because each guard already has the same condition, a later change to the explanation would require
edits in the codemod, legacy-naming-strategies, and coverage jobs.
Code

.github/workflows/tests.yml[R183-184]

+        # Neither a fork nor Dependabot can read SONAR_TOKEN: forks have no
+        # access to secrets, and Dependabot runs read from a separate store.
Evidence
Rule 4 excludes extra comments. The new two-line comment appears verbatim at each of the three scan
guards.

Rule 4: Remove AI-generated noise
.github/workflows/tests.yml[157-158]
.github/workflows/tests.yml[183-184]
.github/workflows/tests.yml[208-209]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The same explanatory comment is repeated above three identical scan guards.
## Fix Focus Areas
- .github/workflows/tests.yml[157-158]
- .github/workflows/tests.yml[183-184]
- .github/workflows/tests.yml[208-209]
## Recommended Fix
Keep the explanation at the first guard and remove the two repeated copies.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@alumni
alumni merged commit aa7934a into master Oct 9, 2026
47 checks passed
@alumni
alumni deleted the fix/release-and-dependabot-ci branch October 9, 2026 16:02
@github-actions github-actions Bot added this to the 2.0.next milestone Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants