Skip to content

Commit d0cc854

Browse files
chore: use ternary operator to avoid "skipped" integration test job (#1490)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Adds a ternary expression as per https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example so that we dont have a "skipped" integration test job in our job list that might cause confusion #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. -->
1 parent 022684f commit d0cc854

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

.github/workflows/integration-test.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Integration Tests
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- main
77
pull_request_target:
8-
branches:
8+
branches:
99
- main
1010
workflow_dispatch:
1111

@@ -16,26 +16,13 @@ permissions:
1616

1717
jobs:
1818
test:
19-
if: github.event_name == 'push'
20-
name: Run tests
19+
name: Run
2120
uses: open-component-model/ocm-integrationtest/.github/workflows/integrationtest.yaml@main
2221
permissions:
2322
contents: write
2423
id-token: write
2524
packages: write
2625
secrets: inherit
2726
with:
28-
ref: ${{ github.ref }}
29-
repo: ${{ github.repository }}
30-
test-pr:
31-
if: github.event_name == 'pull_request_target'
32-
name: Run tests
33-
uses: open-component-model/ocm-integrationtest/.github/workflows/integrationtest.yaml@main
34-
permissions:
35-
contents: write
36-
id-token: write
37-
packages: write
38-
secrets: inherit
39-
with:
40-
ref: ${{ github.event.pull_request.head.ref }}
41-
repo: ${{ github.event.pull_request.head.repo.full_name }}
27+
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.ref || github.ref }}
28+
repo: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}

0 commit comments

Comments
 (0)