|
31 | 31 | # Setup & Configuration |
32 | 32 | Setup: |
33 | 33 | name: "Setup & Configuration " |
34 | | - if: ${{ !(github.event.pull_request.head.repo.fork && github.ref == 'refs/heads/main') }} |
35 | 34 | runs-on: ubuntu-latest |
36 | 35 | outputs: |
37 | 36 | GitVersion_BranchName: ${{ steps.gitversion.outputs.GitVersion_BranchName }} |
|
59 | 58 | uses: actions/checkout@v4 |
60 | 59 | with: |
61 | 60 | fetch-depth: 0 |
62 | | - |
| 61 | + - name: "Fix contibutions if main" |
| 62 | + shell: pwsh |
| 63 | + if: ${{ (github.event.pull_request.head.repo.fork && github.ref == 'refs/heads/main') }} |
| 64 | + id: contributionbranchfix |
| 65 | + run: | |
| 66 | + # Get environment variables |
| 67 | + $branchName = "pr-temp-${{ github.event.pull_request.number }}" |
| 68 | + $newBranchName = "contrib/$branchName" |
| 69 | + git checkout -b $newBranchName |
63 | 70 | - name: Install GitVersion |
64 | 71 | uses: gittools/actions/gitversion/[email protected] |
65 | 72 | with: |
@@ -160,23 +167,30 @@ jobs: |
160 | 167 | Write-Output "-------------------------------------------" |
161 | 168 | Write-Output "Get-ReleaseDescription" |
162 | 169 | Write-Output "-------------------------------------------" |
163 | | - Write-Output "Running Get-ReleaseDescription.ps1" |
164 | | - . .\build\include\Get-ReleaseDescription.ps1 |
165 | | - $description = Get-ReleaseDescription -mode log -OPEN_AI_KEY ${{ secrets.OPENAI_API_KEY }} |
166 | | - if ($description -eq $null) { |
167 | | - $description = "No release description found"; |
168 | | - echo "release_description_state=false" >> $env:GITHUB_OUTPUT |
169 | | - } else { |
170 | | - echo "release_description_state=true" >> $env:GITHUB_OUTPUT |
| 170 | + if ($env:GITHUB_EVENT_NAME -ne "pull_request" -and $eventName -ne "pull_request_target") |
| 171 | + { |
| 172 | + Write-Output "Running Get-ReleaseDescription.ps1" |
| 173 | + . .\build\include\Get-ReleaseDescription.ps1 |
| 174 | + $description = Get-ReleaseDescription -mode log -OPEN_AI_KEY ${{ secrets.OPENAI_API_KEY }} |
| 175 | + if ($description -eq $null) { |
| 176 | + $description = "No release description found"; |
| 177 | + echo "release_description_state=false" >> $env:GITHUB_OUTPUT |
| 178 | + } else { |
| 179 | + echo "release_description_state=true" >> $env:GITHUB_OUTPUT |
171 | 180 |
|
| 181 | + } |
| 182 | + $EOF = -join (1..15 | ForEach {[char]((48..57)+(65..90)+(97..122) | Get-Random)}) |
| 183 | + echo "release_description<<$EOF" >> $env:GITHUB_OUTPUT |
| 184 | + echo $description >> $env:GITHUB_OUTPUT |
| 185 | + echo "$EOF" >> $env:GITHUB_OUTPUT |
| 186 | + } else { |
| 187 | + $description = "Skipping for PR!" |
| 188 | + echo "release_description=$description" >> $env:GITHUB_OUTPUT |
| 189 | + Write-Output $description |
172 | 190 | } |
173 | | - $EOF = -join (1..15 | ForEach {[char]((48..57)+(65..90)+(97..122) | Get-Random)}) |
174 | | - echo "release_description<<$EOF" >> $env:GITHUB_OUTPUT |
175 | | - echo $description >> $env:GITHUB_OUTPUT |
176 | | - echo "$EOF" >> $env:GITHUB_OUTPUT |
| 191 | + |
177 | 192 | Write-Output "-------------------------------------------" |
178 | 193 | Write-Output "::endgroup::" |
179 | | -
|
180 | 194 | - uses: actions/upload-artifact@v4 |
181 | 195 | with: |
182 | 196 | name: AzureDevOpsMigrationTools-Scripts |
@@ -541,7 +555,7 @@ jobs: |
541 | 555 | name: "Release to Docs" |
542 | 556 | runs-on: ubuntu-latest |
543 | 557 | needs: [Setup, BuildDocs] |
544 | | - if: ${{ success() }} |
| 558 | + if: ${{ !(github.event.pull_request.head.repo.fork) }} |
545 | 559 | steps: |
546 | 560 | - name: Download a single artifact |
547 | 561 | uses: actions/download-artifact@v4 |
|
0 commit comments