I have following workflow
name: Test set path
on:
workflow_dispatch:
jobs:
test-cross-aws:
runs-on: [self-hosted, '${{ matrix.platform.os }}', x64, '${{ matrix.platform.label }}']
#runs-on: windows-latest
strategy:
matrix:
platform: [{ os: windows, label: wix-aws-windows-test }]
steps:
- name: create fake batchfile
if: always()
run: |
mkdir testfolder
echo "@echo off" | Out-File -FilePath testfolder/testbatch.bat -Encoding utf8
echo "echo SOMETHING" | Out-File -FilePath testfolder/testbatch.bat -Encoding utf8
- name: add path
if: always()
run: echo "$pwd\testfolder;" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: run custom binary with path
if: always()
run: testbatch.bat
It works ok on regular github action windows runner. But it fails on self-hosted github runner built from this image The error is
testbatch.bat : The term 'testbatch.bat' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\actions-runner\_work\_temp\744d9b45-8f99-4db5-ba7d-b95aad4dde97.ps1:2 char:1
+ testbatch.bat
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (testbatch.bat:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException
Error: Process completed with exit code 1.
Github runner version is 2.303.0 Windows i use is Windows 2022 datacenter.