Skip to content

Commit

Permalink
fix: GH action checkout bug (#2924)
Browse files Browse the repository at this point in the history
* fix: Config git to fix issue with checkout action with safe.directory
and disable shellcheck

	- actions/checkout#760
	- feat: disable SC on GH action workflows
	  - SC2006:style:2:21: Use $(...) notation instead of legacy backticks `...`
	  - SC2086:info:2:48: Double quote to prevent globbing and word splitting

* fix: remove SC disble but add .github/workflows into
FILTER_REGEX_EXCLUDE

	- dont think .github/linters/.jscpd.json works

* fix: linter

* Revert "fix: remove SC disble but add .github/workflows into"

This reverts commit 3545f3f.

* fix: more linter

* fix: change to use linux path than windows path in ubuntu container

* fix: upgrade to v3 fixed is in v3.0.2

-
https://github.com/actions/checkout/blob/2541b1294d2704b0964813337f33b291d3f8596b/CHANGELOG.md#v302

* fix: trying with a solution for cygwin

	- ref: actions/checkout#767
	- ref2: https://github.com/me-and/Cygwin-Git/actions/runs/2307847122/workflow

* fix: Config git to fix issue with checkout action with safe.directory
and disable shellcheck

	- actions/checkout#760
	- feat: disable SC on GH action workflows
	  - SC2006:style:2:21: Use $(...) notation instead of legacy backticks `...`
	  - SC2086:info:2:48: Double quote to prevent globbing and word splitting

* fix: remove SC disble but add .github/workflows into
FILTER_REGEX_EXCLUDE

	- dont think .github/linters/.jscpd.json works

* fix: linter

* Revert "fix: remove SC disble but add .github/workflows into"

This reverts commit 3545f3f.

* fix: more linter

* fix: change to use linux path than windows path in ubuntu container

* fix: upgrade to v3 fixed is in v3.0.2

-
https://github.com/actions/checkout/blob/2541b1294d2704b0964813337f33b291d3f8596b/CHANGELOG.md#v302

* fix: trying with a solution for cygwin

	- ref: actions/checkout#767
	- ref2: https://github.com/me-and/Cygwin-Git/actions/runs/2307847122/workflow

* fix: syntax for pwsh

* fix: mark run to use pwsh
  • Loading branch information
zdtsw committed May 16, 2022
1 parent 76dff91 commit 586d248
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/build.yml
Expand Up @@ -81,8 +81,8 @@ jobs:
tar -xf "${GITHUB_WORKSPACE}/workspace/target/OpenJDK.tar.gz" -C "${HOME}/JDK"
- name: Set root of jdk image dir
run: |
imageroot=`find ${HOME}/JDK -name release -type f`
echo "TEST_JDK_HOME=`dirname ${imageroot}`" >> $GITHUB_ENV
imageroot=$(find "${HOME}/JDK" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" >> "$GITHUB_ENV"
- name: Smoke test
uses: adoptium/run-aqa@v1
with:
Expand Down Expand Up @@ -158,8 +158,8 @@ jobs:
- name: Set root of jdk image dir
run: |
imageroot=`find ${HOME}/JDK -name release -type f`
echo "TEST_JDK_HOME=`dirname ${imageroot}`" >> $GITHUB_ENV
imageroot=$(find "${HOME}/JDK" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" >> "$GITHUB_ENV"
- name: Smoke test
uses: adoptium/run-aqa@v1
with:
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
Start-Process -Wait -FilePath 'C:\temp\git.exe' -ArgumentList '/SILENT /ALLOWDOWNGRADE=1** /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh"'
- name: Set PATH
run: echo "C:\cygwin64\bin;C:\Program Files\Git\bin;" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
run: echo "C:\cygwin64\bin;C:\Program Files\Git\bin;" | Out-File -FilePath "$env:GITHUB_PATH" -Encoding utf8 -Append

- name: Install Visual Studio 2013
run: |
Expand All @@ -225,18 +225,20 @@ jobs:

- name: Cygwin git configuration
shell: bash
run: mkdir $HOME && git config --system core.autocrlf false
run: mkdir "$HOME" && git config --system core.autocrlf false && git config --global --add safe.directory '*'

- uses: actions/checkout@v2
- uses: actions/checkout@v3.0.2
with:
set-safe-directory: false

- name: Setup 8dot3name
run: fsutil behavior set disable8dot3 0

- name: Set JAVA_HOME
run: echo "JAVA_HOME=$(cygpath ${{ steps.setup-java11.outputs.path }})" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
run: echo "JAVA_HOME=$(cygpath "${{ steps.setup-java11.outputs.path }}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append

- name: Set JDK7_BOOT_DIR
run: echo "JDK7_BOOT_DIR=$(cygpath ${{ steps.setup-java7.outputs.path }})" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
run: echo "JDK7_BOOT_DIR=$(cygpath "${{ steps.setup-java7.outputs.path }}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
if: matrix.version == 'jdk8u'

- name: Build Windows
Expand All @@ -261,14 +263,16 @@ jobs:
with:
name: ${{matrix.version}}-${{matrix.os}}-${{matrix.vm}}
path: ~/${{matrix.version}}-${{matrix.os}}-${{matrix.vm}}

- name: Unpack jdk
run: |
unzip "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.vm}}/OpenJDK.zip" -d "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.vm}}"
- name: Set root of jdk image dir
shell: pwsh
run: |
$imageroot = find ${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.vm}} -name release -type f
echo "TEST_JDK_HOME=$(dirname ${imageroot})" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$imageroot=$(find "${HOME}/${{matrix.version}}-${{matrix.os}}-${{matrix.vm}}" -name release -type f)
echo "TEST_JDK_HOME=$(dirname "${imageroot}")" | Out-File -FilePath "$env:GITHUB_ENV" -Encoding utf8 -Append
- name: Smoke test
uses: adoptium/run-aqa@v1
with:
Expand Down

0 comments on commit 586d248

Please sign in to comment.