Skip to content

Commit

Permalink
OpenUSD: BuildUSD workflow: Fix issue_comment ref
Browse files Browse the repository at this point in the history
(Internal change: 2344661)
  • Loading branch information
LiamGFX authored and pixar-oss committed Oct 15, 2024
1 parent 0b6dd83 commit 1141751
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/buildusd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,38 @@ jobs:
with:
require: 'write'
username: ${{ github.event.comment.user.login }}
GetGitRef:
runs-on: ubuntu-20.04
timeout-minutes: 5
outputs:
ref: ${{ steps.setter.outputs.ref }}
steps:
- name: Get push ref
if: ${{ github.event_name == 'push' }}
run: |
echo "REF=${{ github.ref }}" >> $GITHUB_ENV
- name: Get PR ref
if: ${{ github.event.issue.pull_request }}
run: |
echo "REF=refs/pull/${{ github.event.issue.number }}/merge" >> $GITHUB_ENV
- name: Print ENV_VAR
run: |
echo "The value of REF is $REF"
- name: Set ENV_VAR
id: setter
run: |
echo "ref=$REF" >> "$GITHUB_OUTPUT"
Linux:
needs: [GetUser]
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: ubuntu-20.04
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -68,14 +91,16 @@ jobs:
path: USDinst

macOS:
needs: [GetUser]
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: macos-13
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -115,14 +140,16 @@ jobs:
path: USDinst

Windows:
needs: [GetUser]
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: windows-2019
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
Expand Down

0 comments on commit 1141751

Please sign in to comment.