Skip to content

ci: update pipelines#4381

Draft
johnhwhite wants to merge 2 commits intomainfrom
update-pipeline-versions
Draft

ci: update pipelines#4381
johnhwhite wants to merge 2 commits intomainfrom
update-pipeline-versions

Conversation

@johnhwhite
Copy link
Copy Markdown
Member

@johnhwhite johnhwhite commented Apr 16, 2026

Summary by CodeRabbit

  • Chores
    • Upgraded GitHub Actions dependencies to latest versions for enhanced security and reliability.
    • Improved internal CI/CD workflow configurations and automation efficiency.
    • Refined automated translation branch synchronization process.

@johnhwhite johnhwhite requested a review from a team as a code owner April 16, 2026 18:47
@johnhwhite johnhwhite added risk level (author): 1 No additional bugs expected from this change skip e2e Do not run e2e tests labels Apr 16, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bc35b55-effb-49aa-95cf-eb278e6d807f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR updates GitHub Actions workflows across the CI/CD pipeline with version upgrades (checkout v5→v6, setup-node v5→v6, artifact actions v4/v5→v7), updates Slack notification action pins, removes merge_group triggers, refines concurrency logic, and adjusts secret management. Additionally, it modifies the automated-translations PowerShell script to use git rebase with force-with-lease instead of merge for LTS branch synchronization.

Changes

Cohort / File(s) Summary
GitHub Actions Version Upgrades
.github/workflows/automated-translations.yml, .github/workflows/cherry-pick.yml, .github/workflows/ci.yml, .github/workflows/e2e-cleanup.yml, .github/workflows/e2e.yml, .github/workflows/release-please.yml
Updated actions/checkout from v5 to v6 and actions/setup-node from v5 to v6 across multiple workflows; also upgraded actions/upload-artifact v4→v7 and actions/download-artifact v5→v7 in e2e.yml and release-please.yml.
Slack Notification Pin Updates
.github/workflows/automated-translations.yml, .github/workflows/cherry-pick.yml, .github/workflows/ci.yml, .github/workflows/e2e.yml, .github/workflows/release-please.yml
Updated pinned commit SHA for rtCamp/action-slack-notify from v2.3.3 to a new commit hash (referenced via PR link) across multiple notification steps.
Workflow Trigger & Concurrency Refinements
.github/workflows/automated-translations.yml, .github/workflows/ci.yml, .github/workflows/e2e.yml
Removed merge_group trigger (checks_requested), added dynamic LTS branch detection via new determine-lts job in automated-translations.yml, and simplified concurrency group expressions by removing github.event.ref fallback logic.
Secret & Environment Management
.github/workflows/validate-pr.yml, .github/workflows/e2e.yml
Removed workflow-wide env.GITHUB_TOKEN export; moved GITHUB_TOKEN from workflow-level to step/job-level scoping and changed source from secrets.GH_PERSONAL_ACCESS_TOKEN to secrets.GITHUB_TOKEN; moved NX_CLOUD_ACCESS_TOKEN from job-level to step-level in build-apps job.
Runner & Action Configuration Updates
.github/workflows/e2e.yml, .github/workflows/validate-pr.yml
Changed runner from ubuntu-latest to ubuntu-slim for environment-check and conventional-title jobs; adjusted checkout logic to use github.head_ref || github.ref_name instead of fallback to github.event.ref.
Automated Translations Git Workflow
scripts/automated-translations.ps1
Changed LTS branch synchronization from git merge -X theirs to git rebase -X ours unconditionally; added --force-with-lease flag to git push in non-dry-run mode, replacing simple push behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • blackbaud/skyux#4299: Modifies .github/workflows/e2e.yml with workflow behavior and input changes, with overlapping updates to workflow configuration and concurrency logic.

Suggested reviewers

  • Blackbaud-SteveBrush

Poem

🐰 Hops of version, bounds so high,
Actions upgrade, secrets comply,
Merge-groups gone, rebase now reigns,
Workflows refined, concurrency gains!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'ci: update pipelines' is vague and generic. While it correctly indicates changes to CI workflows, it doesn't convey what specifically was updated across the multiple workflow files and scripts modified in the changeset. Consider a more specific title that highlights the primary change, such as 'ci: upgrade GitHub Actions versions across workflows' or 'ci: update workflows with v6 Actions and dynamic LTS branch detection'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-pipeline-versions

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 16, 2026

View your CI Pipeline Execution ↗ for commit 2f6ac5a

Command Status Duration Result
nx build playground --baseHref=https://blackbau... ✅ Succeeded 19s View ↗
nx build code-examples-playground --baseHref=ht... ✅ Succeeded 11s View ↗
nx build integration --baseHref=https://blackba... ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-17 13:34:36 UTC

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/automated-translations.yml:
- Line 15: The branch filter pattern '[0-9]+.x.x' in the GitHub Actions
workflow's on.push.branches is using regex semantics but GitHub Actions uses
glob/minimatch, so it won't match multi-digit release branches (e.g., 12.x.x);
update the branch filter to use a glob pattern like '[0-9]*.x.x' in the workflow
file so multiple-digit version branches trigger the workflow (edit the branches
entry where '[0-9]+.x.x' appears).

In @.github/workflows/e2e.yml:
- Around line 57-61: The checkout step using actions/checkout@v6 in the
install-deps job should fetch from the PR head repo for forked PRs; change the
repository input to use the same expression used elsewhere
(github.event.pull_request.head.repo.full_name || github.repository) so the
checkout pulls from the fork when present, and keep ref as github.head_ref ||
github.ref_name to preserve branch selection; update the install-deps job's
checkout step (actions/checkout@v6) to use that repository expression.
- Line 12: The concurrency key uses github.head_ref which is just the branch
name and causes different PRs from forks with the same branch name to collide;
update the top-level concurrency.group expression to append a PR-specific
discriminator such as github.event.pull_request.number or
github.event.pull_request.head.sha (e.g., include
github.event.pull_request.number) instead of only github.head_ref, and apply the
same change to every job-level concurrency.group setting (the concurrency.group
entries in this workflow) so each run is unique per PR; locate and modify the
group expression and each job-level concurrency.group to include the PR-specific
field.

In `@scripts/automated-translations.ps1`:
- Around line 79-80: The script currently runs native git commands (git rebase
-X ours $LtsBranchName and the later git push --force-with-lease) without
failing the PowerShell run on non-zero exits; add explicit post-command error
handling to abort immediately when these commands fail by checking $LASTEXITCODE
(or enabling $PSNativeCommandUseErrorActionPreference) after each git invocation
and exiting with a non-zero code (e.g., exit $LASTEXITCODE) if the command
failed so the PR creation/output logic cannot run on a failed rebase or rejected
push.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bdae23d-cc74-414d-8605-f6a52c51c452

📥 Commits

Reviewing files that changed from the base of the PR and between 04d11f7 and 41ff63c.

📒 Files selected for processing (8)
  • .github/workflows/automated-translations.yml
  • .github/workflows/cherry-pick.yml
  • .github/workflows/ci.yml
  • .github/workflows/e2e-cleanup.yml
  • .github/workflows/e2e.yml
  • .github/workflows/release-please.yml
  • .github/workflows/validate-pr.yml
  • scripts/automated-translations.ps1

push:
branches:
- 12.x.x
- '[0-9]+.x.x'
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Apr 16, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Do GitHub Actions on.push.branchesfilters use glob patterns or regular expressions, and would the pattern[0-9]+.x.xmatch a branch named12.x.x?

💡 Result:

GitHub Actions on.push.branches filters use glob patterns, not regular expressions. The pattern [0-9]+.x.x would NOT match the branch named 12.x.x. In GitHub Actions glob patterns (powered by @actions/glob using minimatch): - [] matches exactly ONE character from the specified set or range (e.g., [0-9] matches a single digit 0-9). - + is a literal character, not a quantifier (unlike regex where + means "one or more"). It does not repeat the preceding element. - Therefore, [0-9]+ matches exactly one digit (0-9) followed by a literal + character. For 12.x.x: - Position 1: 1 (matches [0-9]) - Position 2: 2 (does NOT match literal +) - No match.

Citations:


🏁 Script executed:

# Verify the actual content at line 15 of the workflow file
if [ -f ".github/workflows/automated-translations.yml" ]; then
  echo "=== File content around line 15 ==="
  sed -n '10,20p' .github/workflows/automated-translations.yml | cat -n
else
  echo "File not found"
fi

Repository: blackbaud/skyux

Length of output: 324


Use a glob pattern instead of a regex pattern for the branch filter.

on.push.branches uses GitHub's glob matcher (minimatch), so [0-9]+.x.x will not match multi-digit release branches like 12.x.x. In glob patterns, [0-9] matches a single digit and + is treated as a literal character, not a quantifier. This pattern prevents LTS pushes from triggering the workflow.

Change to [0-9]*.x.x to match any number of digits.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/automated-translations.yml at line 15, The branch filter
pattern '[0-9]+.x.x' in the GitHub Actions workflow's on.push.branches is using
regex semantics but GitHub Actions uses glob/minimatch, so it won't match
multi-digit release branches (e.g., 12.x.x); update the branch filter to use a
glob pattern like '[0-9]*.x.x' in the workflow file so multiple-digit version
branches trigger the workflow (edit the branches entry where '[0-9]+.x.x'
appears).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not accurate. The change is valid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@johnhwhite, you're correct — I apologize for the inaccurate review comment.

The branches and branches-ignore keywords accept glob patterns that use characters like *, **, +, ?, ! and others to match more than one branch name. In GitHub Actions' extended glob syntax, + is a special character (not a literal), so [0-9]+ means "one or more digits" — making [0-9]+.x.x a valid pattern that correctly matches multi-digit version branches like 12.x.x. The change is indeed valid.


✏️ Learnings added
Learnt from: johnhwhite
Repo: blackbaud/skyux PR: 4381
File: .github/workflows/automated-translations.yml:15-15
Timestamp: 2026-04-17T11:19:33.262Z
Learning: In GitHub Actions `on.push.branches` (and similar) filter patterns, `+` is a special character meaning "one or more of the preceding element" (extended glob semantics), not a literal character. For example, `[0-9]+.x.x` correctly matches multi-digit version branch names like `12.x.x`. This is confirmed by the GitHub Actions documentation which lists `+` as a special glob character in branch filter patterns.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread .github/workflows/e2e.yml Outdated

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.head_ref || github.ref_name }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

In GitHub Actions pull_request_targetworkflows, isgithub.head_ref unique across different forks, or is it only the source branch name?

💡 Result:

In GitHub Actions pull_request_target workflows, github.head_ref is the source branch name (e.g., "feature-branch"), not a unique identifier across different forks. It is only the branch name from the head of the pull request, regardless of whether the PR originates from the same repository or a fork. To distinguish forks, use github.event.pull_request.head.repo.full_name != github.repository or check github.event.pull_request.head.repo.fork.

Citations:


🏁 Script executed:

cat -n .github/workflows/e2e.yml | head -50

Repository: blackbaud/skyux

Length of output: 2129


🏁 Script executed:

cat -n .github/workflows/e2e.yml | grep -A 2 -B 2 "group:"

Repository: blackbaud/skyux

Length of output: 1804


Make these concurrency keys unique per PR, not just per branch name.

github.head_ref is only the source branch name. Two fork PRs opened from identically named branches like main or release will share these groups and cancel each other's runs/jobs.

Example for the top-level key
-  group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.head_ref || github.ref_name }}
+  group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || format('{0}-{1}', github.event.pull_request.number || github.run_id, github.head_ref || github.ref_name) }}

Apply the same PR-specific discriminator to the job-level concurrency.group values at lines 46, 114, 159, 219, and 427.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.head_ref || github.ref_name }}
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || format('{0}-{1}', github.event.pull_request.number || github.run_id, github.head_ref || github.ref_name) }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/e2e.yml at line 12, The concurrency key uses
github.head_ref which is just the branch name and causes different PRs from
forks with the same branch name to collide; update the top-level
concurrency.group expression to append a PR-specific discriminator such as
github.event.pull_request.number or github.event.pull_request.head.sha (e.g.,
include github.event.pull_request.number) instead of only github.head_ref, and
apply the same change to every job-level concurrency.group setting (the
concurrency.group entries in this workflow) so each run is unique per PR; locate
and modify the group expression and each job-level concurrency.group to include
the PR-specific field.

Comment thread .github/workflows/e2e.yml
Comment on lines +57 to +61
- uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref_name || github.event.ref }}
- uses: actions/setup-node@v5
repository: ${{ github.repository }}
ref: ${{ github.head_ref || github.ref_name }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

For pull_request_targetworkflows, what dogithub.repositoryandgithub.head_refresolve to on forked PRs, and how doesactions/checkoutuse therepositoryandref inputs together?

💡 Result:

In pull_request_target workflows, which run in the context of the base repository (even for forked PRs): - github.repository resolves to the base repository (e.g., "owner/base-repo"), as the workflow executes in the base repo's context. This is consistent across all events, including forked PRs, since pull_request_target workflows run against the base branch's code and context. - github.head_ref resolves to the source branch name from the PR's head (e.g., "feature-branch"). This is available for both pull_request and pull_request_target events. For actions/checkout: - The repository input defaults to ${{ github.repository }} (base repo). - The ref input defaults to the reference or SHA that triggered the workflow (for pull_request_target, typically the base branch's ref/SHA, like "refs/heads/main"). To checkout the PR's head commit from a fork, explicitly set repository: ${{ github.event.pull_request.head.repo.full_name }} and ref: ${{ github.head_ref }} or ${{ github.event.pull_request.head.sha }}. This allows fetching from the fork using the workflow's GITHUB_TOKEN (which has access to the base repo but can fetch public forks or same-org forks). Note: Never run untrusted PR code in pull_request_target without validation, as it has access to secrets.

Citations:


🏁 Script executed:

cat -n .github/workflows/e2e.yml | head -70

Repository: blackbaud/skyux

Length of output: 2955


🏁 Script executed:

cat -n .github/workflows/e2e.yml | tail -n +100

Repository: blackbaud/skyux

Length of output: 25052


Fix install-deps checkout to fetch from fork for pull_request_target events.

On pull_request_target, github.repository is the base repo while github.head_ref is only the source branch name. For fork PRs, this causes the step to either fail (if the branch doesn't exist in the base repo) or silently check out the wrong code (if the fork branch name collides with a base repo branch like main).

Other jobs in this workflow (build-storybook, build-apps, e2e) correctly use ${{ github.event.pull_request.head.repo.full_name || github.repository }} to fetch from the fork when available.

Apply the same pattern to install-deps
       - uses: actions/checkout@v6
         with:
           fetch-depth: 0
-          repository: ${{ github.repository }}
+          repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
           ref: ${{ github.head_ref || github.ref_name }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref_name || github.event.ref }}
- uses: actions/setup-node@v5
repository: ${{ github.repository }}
ref: ${{ github.head_ref || github.ref_name }}
- uses: actions/checkout@v6
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.head_ref || github.ref_name }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/e2e.yml around lines 57 - 61, The checkout step using
actions/checkout@v6 in the install-deps job should fetch from the PR head repo
for forked PRs; change the repository input to use the same expression used
elsewhere (github.event.pull_request.head.repo.full_name || github.repository)
so the checkout pulls from the fork when present, and keep ref as
github.head_ref || github.ref_name to preserve branch selection; update the
install-deps job's checkout step (actions/checkout@v6) to use that repository
expression.

Comment on lines +79 to +80
Write-Output "`n# git rebase -X ours $LtsBranchName"
git rebase -X ours $LtsBranchName
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In PowerShell, do native command failures like git rebaseorgit pushstop script execution by default, or do scripts need to check$LASTEXITCODE/ enable$PSNativeCommandUseErrorActionPreference explicitly?

💡 Result:

By default, native command failures like git rebase or git push (non-zero exit codes) do not stop PowerShell script execution. Scripts must explicitly check $LASTEXITCODE after such commands (e.g., if ($LASTEXITCODE -ne 0) { throw }), or enable integration with PowerShell's error handling by setting $PSNativeCommandUseErrorActionPreference = $true (PowerShell 7.3+). With this set to $true (opt-in, default is $false) and $ErrorActionPreference = 'Stop', non-zero exit codes trigger a terminating error that stops execution. This behavior differs from PowerShell cmdlets, where $ErrorActionPreference = 'Stop' (default: 'Continue') stops on non-terminating errors without extra steps. Official docs confirm: $PSNativeCommandUseErrorActionPreference default is $false (about_Preference_Variables). Multiple sources (StackOverflow, GitHub issues, blogs) emphasize manual $LASTEXITCODE checks are traditionally required for external commands like git. Example to stop on native failure: $ErrorActionPreference = 'Stop' $PSNativeCommandUseErrorActionPreference = $true git push # Stops script if non-zero exit code Without $PSNativeCommandUseErrorActionPreference = $true, use: git push if ($LASTEXITCODE -ne 0) { throw "git push failed with exit code $LASTEXITCODE" }

Citations:


🏁 Script executed:

# First, locate and examine the script file
find . -name "automated-translations.ps1" -type f

Repository: blackbaud/skyux

Length of output: 95


🏁 Script executed:

# Get the file size first
wc -l ./scripts/automated-translations.ps1

Repository: blackbaud/skyux

Length of output: 99


🏁 Script executed:

# Check lines 75-85 to see context around the git rebase (lines 79-80)
sed -n '75,85p' ./scripts/automated-translations.ps1 | cat -n

echo "---"

# Check lines 125-135 to see context around git push (lines 129-130)
sed -n '125,135p' ./scripts/automated-translations.ps1 | cat -n

echo "---"

# Check if $PSNativeCommandUseErrorActionPreference is set anywhere
rg 'PSNativeCommandUseErrorActionPreference' ./scripts/automated-translations.ps1

echo "---"

# Check for $LASTEXITCODE usage in the script
rg 'LASTEXITCODE' ./scripts/automated-translations.ps1

Repository: blackbaud/skyux

Length of output: 923


🏁 Script executed:

# Check the beginning of the script for any error handling setup
head -20 ./scripts/automated-translations.ps1 | cat -n

echo "---"

# Check if there's any overall error handling pattern in the script
rg 'ErrorActionPreference|exit|throw' ./scripts/automated-translations.ps1

Repository: blackbaud/skyux

Length of output: 603


🏁 Script executed:

# Let's verify the exact lines mentioned in the review by showing more context
sed -n '76,85p' ./scripts/automated-translations.ps1 | cat -n

echo "---"

# Check the lines around the push command more carefully
sed -n '126,135p' ./scripts/automated-translations.ps1 | cat -n

Repository: blackbaud/skyux

Length of output: 826


Abort immediately when the rebase or lease-protected push fails.

PowerShell will continue script execution after native commands like git rebase or git push return non-zero exit codes unless you explicitly check $LASTEXITCODE or enable $PSNativeCommandUseErrorActionPreference. A rebase conflict or rejected --force-with-lease can therefore proceed silently into the later PR creation and output logic.

Add error checks after both commands:

Suggested guardrails
   Write-Output "`n# git rebase -X ours $LtsBranchName"
   git rebase -X ours $LtsBranchName
+  if ($LASTEXITCODE -ne 0)
+  {
+    Write-Output "`n::error::Failed to rebase $TranslationBranchName onto $LtsBranchName.`n"
+    exit $LASTEXITCODE
+  }
   Write-Output "`n::endgroup::`n"
…
   if (-not $IsDryRunBool)
   {
     Write-Output "`n# git push --force-with-lease origin $TranslationBranchName"
     git push --force-with-lease origin $TranslationBranchName
+    if ($LASTEXITCODE -ne 0)
+    {
+      Write-Output "`n::error::Failed to push $TranslationBranchName.`n"
+      exit $LASTEXITCODE
+    }
   }

Also applies to: lines 129-130

🧰 Tools
🪛 PSScriptAnalyzer (1.25.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'automated-translations.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/automated-translations.ps1` around lines 79 - 80, The script
currently runs native git commands (git rebase -X ours $LtsBranchName and the
later git push --force-with-lease) without failing the PowerShell run on
non-zero exits; add explicit post-command error handling to abort immediately
when these commands fail by checking $LASTEXITCODE (or enabling
$PSNativeCommandUseErrorActionPreference) after each git invocation and exiting
with a non-zero code (e.g., exit $LASTEXITCODE) if the command failed so the PR
creation/output logic cannot run on a failed rebase or rejected push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk level (author): 1 No additional bugs expected from this change skip e2e Do not run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants