Skip to content

Conversation

@avidal
Copy link
Collaborator

@avidal avidal commented Aug 19, 2025

To avoid potentially overwriting changes on the remote, allow callers to specify --head-sha (defaulting to the current HEAD on the remote, which is the previous behavior). This mitigates issues with potentially overwriting remote changes on long running jobs or active branches, particularly with jobs that rewrite file contents (such as lint fixes / auto formatting).

  • Replace --branch-from= with the pair of --head-sha= and --create-branch
  • Skip fetching current remote HEAD if --head-sha is supplied

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Aug 19, 2025

⚠️ Code Quality    ✅ Code Vulnerabilities    ✅ Library Vulnerabilities

⚠️ Warnings

🛠️ 1 Code quality issue detected

Medium: javascript-best-practices/no-console Avoid leaving console debug statements View rule
action-template/action.js:56

ℹ️ Info

🛡️ No new code vulnerabilities
📚 No new vulnerable libraries detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9c5a67e | Docs | Was this helpful? Give us feedback!


const createBranch = process.env["INPUT_CREATE-BRANCH"] || "false"
if(!["true", "false"].includes(createBranch.toLowerCase())) {
console.error(`Invalid value for create-branch (${createBranch}). Must be one of true or false.`);
Copy link

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 bot Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Medium: Code Quality Violation

Unexpected console statement. (...read more)

Debugging with console (such as console.log or console.info) is not considered a bad practice, but these statements can be accidentally left in production code, leading to unnecessary log pollution. It is important to remove or replace these debugging statements to maintain clean and secure production builds.

✨ Generate fix

View in Datadog  Leave us feedback  Documentation

To avoid potentially overwriting changes on the remote, allow callers to
specify `--head-sha` (defaulting to the current HEAD on the remote,
which is the previous behavior). This mitigates issues with potentially
overwriting remote changes on long running jobs or active branches,
particularly with jobs that rewrite file contents (such as lint fixes /
auto formatting).

- Replace --branch-from=<sha> with the pair of --head-sha=<sha> and
  --create-branch
- Skip fetching current remote HEAD if --head-sha is supplied
@avidal avidal merged commit 4b1ca1a into main Aug 19, 2025
9 checks passed
@avidal avidal deleted the require-head-sha branch August 19, 2025 15:55
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.

2 participants