Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Self hosted windows runner executes yaml anchors in bash?

Dirk Schuermans
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 10, 2024

Given the following pipeline definition:

definitions:
common-items: #https://stackoverflow.com/a/79179771
- initialize: &initialize |
Import-Module ".\.bitbucket\Virto_Functions.psm1"
.\.bitbucket\initialize_step.ps1
pipelines:
  pull-requests:
    '**':
      - step:
          name: "Build & test"
          script:
           - $env:DISABLE_EAZFUSCATOR="true"
           - *initialize

My build then fails with the message

+ $env:DISABLE_EAZFUSCATOR="true"
bash: :DISABLE_EAZFUSCATOR=true: command not found

Any thoughts? It appears that it's executing this using bash and not powershell..

I have my entire pipeline working just fine using the documented YAML anchor functionality, but I stumbled upon this "hidden" feature on StackOverflow

I really want to have a way to re-use sets of scripts, instead of having to duplicate entire steps simply to leave out a few script lines

1 answer

1 accepted

0 votes
Answer accepted
Dirk Schuermans
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 11, 2024

Doh, major facepalm here.

I forgot to add the runs-on:

image.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events