@@ -101,7 +101,7 @@ jobs:
101101 uses : actions/checkout@v4
102102 with :
103103 fetch-depth : 0
104- ref : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref }}
104+ ref : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref_name }}
105105
106106 - name : " Set Git Config"
107107 run : |
@@ -111,7 +111,7 @@ jobs:
111111
112112 - name : Authenticate node
113113 uses : navikt/sf-platform/.github/actions/authenticateNode@main
114- if : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
114+ if : ${{ ( github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name }}
115115
116116 - name : Authenticate DevHub
117117 uses : navikt/sf-platform/.github/actions/authenticateOrg@main
@@ -125,6 +125,8 @@ jobs:
125125 with :
126126 devhub : " devhub"
127127 pools : " ciPlatform"
128+ ref : ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') && github.event.workflow_run.head_sha || '' }}
129+ baseRef : ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') && github.event.workflow_run.pull_requests.base.sha || '' }}
128130
129131 - name : Quick build
130132 uses : navikt/sf-platform/.github/actions/ciQuickBuild@main
@@ -134,18 +136,18 @@ jobs:
134136
135137 - name : Publish artifacts
136138 uses : navikt/sf-platform/.github/actions/publishArtifact@main
137- if : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
139+ if : ${{ ( github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
138140 with :
139141 nodeToken : ${{ secrets.GITHUB_TOKEN }}
140142
141143 - name : Generate Release Name
142- if : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
144+ if : ${{ ( github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
143145 id : generate_name
144146 run : |
145147 echo "releaseName=sf-platform_$(date +%s%3N)" >> $GITHUB_OUTPUT
146148
147149 - name : Generate Release Definition
148- if : ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' || github.ref_name == 'main' }}
150+ if : ${{ ( github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') || github.ref_name == 'main' }}
149151 uses : navikt/sf-platform/.github/actions/generateReleaseDefinition@main
150152 with :
151153 branchToCommitTo : ${{ github.ref }}
0 commit comments