Skip to content

Commit

Permalink
checkout the ref, should work from forks also
Browse files Browse the repository at this point in the history
  • Loading branch information
robandpdx committed Dec 20, 2023
1 parent 521fb5a commit 5e5e371
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/jobs-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
yum install -y git
git clone https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git checkout ${{ github.head_ref }}
git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
git checkout --progress --force ${{ github.ref }}
git log -1 --format='%H'
- uses: "./.github/actions/pre-steps"
- name: Set Java Environment
run: |-
Expand All @@ -53,8 +55,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
yum install -y git
git clone https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git checkout ${{ github.head_ref }}
git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
git checkout --progress --force ${{ github.ref }}
git log -1 --format='%H'
- uses: "./.github/actions/pre-steps"
- name: Set Java Environment
run: |-
Expand All @@ -76,8 +80,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
yum install -y git
git clone https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git checkout ${{ github.head_ref }}
git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
git checkout --progress --force ${{ github.ref }}
git log -1 --format='%H'
- uses: "./.github/actions/pre-steps"
- name: Set Java Environment
run: |-
Expand All @@ -99,8 +105,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
yum install -y git
git clone https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git checkout ${{ github.head_ref }}
git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
git checkout --progress --force ${{ github.ref }}
git log -1 --format='%H'
- uses: "./.github/actions/pre-steps"
- name: Set Java Environment
run: |-
Expand All @@ -122,8 +130,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
yum install -y git
git clone https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git checkout ${{ github.head_ref }}
git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
git checkout --progress --force ${{ github.ref }}
git log -1 --format='%H'
- uses: "./.github/actions/pre-steps"
- name: Set Java Environment
run: |-
Expand Down

0 comments on commit 5e5e371

Please sign in to comment.