Skip to content

Commit

Permalink
Update (#2445)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh authored Oct 9, 2024
2 parents f7b16c3 + ff2c0e6 commit ae06309
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
# Setup & Configuration
Setup:
name: "Setup & Configuration "
if: ${{ !(github.event.pull_request.head.repo.fork && github.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
outputs:
GitVersion_BranchName: ${{ steps.gitversion.outputs.GitVersion_BranchName }}
Expand Down Expand Up @@ -59,7 +58,15 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Fix contibutions if main"
shell: pwsh
if: ${{ (github.event.pull_request.head.repo.fork && github.ref == 'refs/heads/main') }}
id: contributionbranchfix
run: |
# Get environment variables
$branchName = "pr-temp-${{ github.event.pull_request.number }}"
$newBranchName = "contrib/$branchName"
git checkout -b $newBranchName
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
Expand Down Expand Up @@ -160,23 +167,30 @@ jobs:
Write-Output "-------------------------------------------"
Write-Output "Get-ReleaseDescription"
Write-Output "-------------------------------------------"
Write-Output "Running Get-ReleaseDescription.ps1"
. .\build\include\Get-ReleaseDescription.ps1
$description = Get-ReleaseDescription -mode log -OPEN_AI_KEY ${{ secrets.OPENAI_API_KEY }}
if ($description -eq $null) {
$description = "No release description found";
echo "release_description_state=false" >> $env:GITHUB_OUTPUT
} else {
echo "release_description_state=true" >> $env:GITHUB_OUTPUT
if ($env:GITHUB_EVENT_NAME -ne "pull_request" -and $eventName -ne "pull_request_target")
{
Write-Output "Running Get-ReleaseDescription.ps1"
. .\build\include\Get-ReleaseDescription.ps1
$description = Get-ReleaseDescription -mode log -OPEN_AI_KEY ${{ secrets.OPENAI_API_KEY }}
if ($description -eq $null) {
$description = "No release description found";
echo "release_description_state=false" >> $env:GITHUB_OUTPUT
} else {
echo "release_description_state=true" >> $env:GITHUB_OUTPUT
}
$EOF = -join (1..15 | ForEach {[char]((48..57)+(65..90)+(97..122) | Get-Random)})
echo "release_description<<$EOF" >> $env:GITHUB_OUTPUT
echo $description >> $env:GITHUB_OUTPUT
echo "$EOF" >> $env:GITHUB_OUTPUT
} else {
$description = "Skipping for PR!"
echo "release_description=$description" >> $env:GITHUB_OUTPUT
Write-Output $description
}
$EOF = -join (1..15 | ForEach {[char]((48..57)+(65..90)+(97..122) | Get-Random)})
echo "release_description<<$EOF" >> $env:GITHUB_OUTPUT
echo $description >> $env:GITHUB_OUTPUT
echo "$EOF" >> $env:GITHUB_OUTPUT
Write-Output "-------------------------------------------"
Write-Output "::endgroup::"
- uses: actions/upload-artifact@v4
with:
name: AzureDevOpsMigrationTools-Scripts
Expand Down Expand Up @@ -541,7 +555,7 @@ jobs:
name: "Release to Docs"
runs-on: ubuntu-latest
needs: [Setup, BuildDocs]
if: ${{ success() }}
if: ${{ !(github.event.pull_request.head.repo.fork) }}
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
Expand Down

0 comments on commit ae06309

Please sign in to comment.