Skip to content

Commit

Permalink
Update action path to work on windows
Browse files Browse the repository at this point in the history
Previously the path to the action script was `${{ github.action_path }}`
which uses the native path format. On Windows machines this ends up
passing paths with `\` to bash, which bash tries to interpret as escape
characters. "c:\a\b" would get be interpreted as "c:ab".

Now the path replaces all instances of `\` with `/` to work with bash on
Windows. This assumes that `\` would never be used on other github
runners.

Solution was copied from actions/runner#1066
  • Loading branch information
speedyleion committed Jan 29, 2023
1 parent 5eff1a0 commit 19deabc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
- uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go_version }}
- run: ${{ github.action_path }}/build_and_release.sh
- run: ${GITHUB_ACTION_PATH//\\//}/build_and_release.sh
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 19deabc

Please sign in to comment.