GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fail `build.sh` if any command in it fails by mbg · Pull Request #2931 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Jun 12, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR updates build.sh so that it fails if any step in the script fails. Previously, the script would continue running and thus mask unexpected failures. For example, Go is no longer available by default on runners and so an explicit setup-go step was required. However, because the script didn't fail, we didn't notice that failure until now.

To address the Go issue, I updated sync.sh to understand a new installGo input that injects the setup-go step into the workflow.

I tried adding it to the local prepare-test action first, but this resulted in a number of further issues:

  • Adding setup-go there, which has a post-action, forced the entire prepare-test action to have a post-action, which caused problems because the workflow also moves the location of the prepare-test action to outside of the workspace.
  • Moving the local actions back to the workspace then caused a bunch of further issues with workflows not expecting there to be a meaningful .github folder in the workspace.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Fail build.sh if any command in it fails
429b71e
@mbg
mbg force-pushed the mbg/fail-build.sh-on-error branch from 71d8dee to 63beaad Compare June 12, 2025 14:31
@mbg
Add installGo input for adding setup-go step in sync.py
8f71d47
@mbg
mbg force-pushed the mbg/fail-build.sh-on-error branch from 63beaad to 8f71d47 Compare June 16, 2025 11:28
@mbg
mbg marked this pull request as ready for review June 16, 2025 11:43
Copilot AI review requested due to automatic review settings June 16, 2025 11:43
@mbg
mbg requested a review from a team as a code owner June 16, 2025 11:43
Copilot AI reviewed Jun 16, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that Go is explicitly installed in all local workflow runs by adding an actions/setup-go@v5 step, so that build.sh and related scripts will correctly fail if Go is missing.

  • Introduces an Install Go step to every workflow to guarantee a supported Go version is available.
  • Aligns all workflows on go-version: '>=1.21.0' and disables caching of Go installs.
  • Prepares the ground for build.sh to error out early when dependencies are not met.

Reviewed Changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/__test-local-codeql.yml Added Install Go step before fetching bundle
.github/workflows/__swift-custom-build.yml Added Install Go step before init action
.github/workflows/__split-workflow.yml Added Install Go step before init action
.github/workflows/__remote-config.yml Added Install Go step before init action
.github/workflows/__packaging-inputs-js.yml Added Install Go step before init action
.github/workflows/__packaging-config-js.yml Added Install Go step before init action
.github/workflows/__packaging-config-inputs-js.yml Added Install Go step before init action
.github/workflows/__packaging-codescanning-config-inputs-js.yml Added Install Go step before init action
.github/workflows/__multi-language-autodetect.yml Added Install Go step before init action
.github/workflows/__go-tracing-legacy-workflow.yml Replaced old setup-go usage with named step
.github/workflows/__go-tracing-custom-build-steps.yml Replaced old setup-go usage with named step
.github/workflows/__go-tracing-autobuilder.yml Replaced old setup-go usage with named step
.github/workflows/__go-indirect-tracing-workaround.yml Added Install Go step before init action
.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml Added Install Go step before remove step
.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml Added Install Go step before init action
.github/workflows/__go-custom-queries.yml Added Install Go step before init action
.github/workflows/__export-file-baseline-information.yml Added Install Go step before init action
.github/workflows/__build-mode-manual.yml Added Install Go step before init action
.github/workflows/__analyze-ref-input.yml Added Install Go step before init action
.github/workflows/__all-platform-bundle.yml Added Install Go step before init action
Comments suppressed due to low confidence (1)

.github/workflows/__test-local-codeql.yml:48

  • This Install Go step is duplicated across many workflows. Consider extracting it into a reusable workflow snippet or composite action to simplify updates and reduce duplication.
-      - name: Install Go

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
redsun82
redsun82 approved these changes Jun 16, 2025
View reviewed changes

@redsun82 redsun82 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Style nits only on my side.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/sync.py
Comment on lines +111 to +113
installGo = False
if checkSpecification.get('installGo'):
installGo = True if checkSpecification['installGo'].lower() == "true" else False

@redsun82 redsun82 Jun 16, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

if we just use

Suggested change
installGo = False
if checkSpecification.get('installGo'):
installGo = True if checkSpecification['installGo'].lower() == "true" else False
installGo = checkSpecification.get('installGo')

then we can use a more natural

installGo: true

in the test specification, without using stringly typed values. Although I see we use "true" for other cases as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@mbg mbg Jun 16, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, like with the other point, I went with this to mirror the existing inputs. I would be happy to change this though if we can't think of a downside / motivation for why the others are strings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pr-checks/checks/all-platform-bundle.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg merged commit ac30a39 into main Jun 20, 2025
@mbg
mbg deleted the mbg/fail-build.sh-on-error branch June 20, 2025 10:04
@github-actions github-actions Bot mentioned this pull request Jun 27, 2025
Merge main into releases/v3 #2953
Merged
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@redsun82 redsun82 redsun82 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @redsun82
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.