-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changed echo to write-output * Updated Artifacts
- Loading branch information
1 parent
6e588a5
commit 27c652b
Showing
8 changed files
with
121 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ jobs: | |
|
||
- name: Configure merge driver for EA files | ||
run: | | ||
echo "Setting lemontree merge-driver to 'no action'" | ||
Write-Output "Setting lemontree merge-driver to 'no action'" | ||
git config merge.lemontree.name "lemontree merge driver" | ||
git config merge.lemontree.driver "echo Do nothing, manual merge required" | ||
|
@@ -104,7 +104,7 @@ jobs: | |
if($actual_status -ne $expected_status) { | ||
Write-Output "::error::Model is not conflicted please rebase manually." | ||
echo "message=:x: Failed to rebase, the Model is not the only conflict." >> $env:GITHUB_OUTPUT | ||
Write-Output "message=:x: Failed to rebase, the Model is not the only conflict." >> $env:GITHUB_OUTPUT | ||
exit 666 | ||
} | ||
|
@@ -119,26 +119,26 @@ jobs: | |
if($LASTEXITCODE -eq 0){ | ||
Write-Output "No merge conflicts, setting message" | ||
echo "message=:heavy_check_mark: Rebase performed successfully" >> $env:GITHUB_OUTPUT | ||
Write-Output "message=:heavy_check_mark: Rebase performed successfully" >> $env:GITHUB_OUTPUT | ||
} | ||
elseif($LASTEXITCODE -eq 2){ | ||
Write-Output "::error::Internal Error when diffing. Please report such errors to [email protected]" | ||
echo "message=x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
Write-Output "message=x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
exit 2 | ||
} | ||
elseif($LASTEXITCODE -eq 3){ | ||
Write-Output "Merge conflicts present, auto-merge failed" | ||
echo "message=:x: Merge conflicts present, auto-rebase failed" >> $env:GITHUB_OUTPUT | ||
Write-Output "message=:x: Merge conflicts present, auto-rebase failed" >> $env:GITHUB_OUTPUT | ||
exit 3 | ||
} | ||
elseif($LASTEXITCODE -eq 6){ | ||
Write-Output "::warning::Licensing issue of LemonTree.Automation" | ||
echo "message=:x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
Write-Output "message=:x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
exit 6 | ||
} | ||
else{ | ||
Write-Output "::error::Unknown error" | ||
echo "message=x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
Write-Output "message=x: Rebase failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
exit 1 | ||
} | ||
|
@@ -167,13 +167,13 @@ jobs: | |
- name: Create commit | ||
if: ${{ steps.mergeEA.outputs.result == 0 }} | ||
run: | | ||
echo "set user config" | ||
Write-Output "set user config" | ||
git config --global user.name 'LemonTree.Automation' | ||
git config --global user.email '[email protected]' | ||
echo "setting remote state" | ||
Write-Output "setting remote state" | ||
git remote set-url origin https://x-access-token:${{secrets.PAT}}@github.com/${{ github.repository }} | ||
git status --porcelain --untracked-files=no --ignored=no | ||
echo "pushing new commit" | ||
Write-Output "pushing new commit" | ||
git push --force-with-lease | ||
- name: Create Finish Message in PR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,42 +29,42 @@ jobs: | |
github.event.comment.author_association == 'MEMBER' || | ||
github.event.comment.author_association == 'COLLABORATOR') | ||
run: | | ||
echo "org member or invited collaborator: ${{github.event.comment.author_association}}" | ||
echo "result=True" >> $env:GITHUB_OUTPUT | ||
Write-Output "org member or invited collaborator: ${{github.event.comment.author_association}}" | ||
Write-Output "result=True" >> $env:GITHUB_OUTPUT | ||
- id: userAuthByPositiveList | ||
env: | ||
authUsers: "'danielsiegl','FlorianBeerRB'" | ||
run: | | ||
echo "${{github.event.comment.user.login}}" | ||
echo "${{env.authUsers}}" | ||
Write-Output "${{github.event.comment.user.login}}" | ||
Write-Output "${{env.authUsers}}" | ||
$result = ${{env.authUsers}} -contains "${{github.event.comment.user.login}}" | ||
echo "User is in authentication list: $result" | ||
echo "result=$result" >> $env:GITHUB_OUTPUT | ||
ecWrite-Outputho "User is in authentication list: $result" | ||
Write-Output "result=$result" >> $env:GITHUB_OUTPUT | ||
- id: SelectAuthResult | ||
run: | | ||
$result = "False" | ||
if ("${{env.AuthMode}}" -eq "Association") | ||
{ | ||
echo "Setting auth result based on association" | ||
Write-Output "Setting auth result based on association" | ||
$result = "${{ steps.userAuthByAssociation.outputs.result }}" | ||
} | ||
else | ||
{ | ||
if ("${{env.AuthMode}}" -eq "PositiveList") { | ||
echo "Setting auth result based on positive list" | ||
Write-Output "Setting auth result based on positive list" | ||
result = "${{ steps.userAuthByPositiveList.outputs.result }}" | ||
} | ||
else | ||
{ | ||
echo "Unknown authentication mode - Failed" | ||
Write-Output "Unknown authentication mode - Failed" | ||
} | ||
} | ||
echo "result=$result" >> $GITHUB_OUTPUT | ||
Write-Output "result=$result" >> $GITHUB_OUTPUT | ||
if ($result -ne "True") | ||
{ | ||
echo "::error User not Authenticated" | ||
Write-Output "::error User not Authenticated" | ||
} | ||
PerformMerge: | ||
|
@@ -122,7 +122,7 @@ jobs: | |
|
||
- name: Configure merge driver for EA files | ||
run: | | ||
echo "Setting lemontree merge-driver to 'no action'" | ||
Write-Output "Setting lemontree merge-driver to 'no action'" | ||
git config merge.lemontree.name "lemontree merge driver" | ||
git config merge.lemontree.driver "echo Do nothing, manual merge required" | ||
|
@@ -131,14 +131,14 @@ jobs: | |
run: | | ||
git fetch | ||
$baseId = git merge-base origin/${{steps.pr_details.outputs.base}} origin/${{steps.pr_details.outputs.head}} | ||
echo "baseCommitId=$baseId" >> $env:GITHUB_OUTPUT | ||
Write-Output "baseCommitId=$baseId" >> $env:GITHUB_OUTPUT | ||
$sourceId = git show-ref --hash origin/${{steps.pr_details.outputs.head}} | ||
echo "sourceCommitId=$sourceId" >> $env:GITHUB_OUTPUT | ||
Write-Output "sourceCommitId=$sourceId" >> $env:GITHUB_OUTPUT | ||
$targetId = git show-ref --hash origin/${{steps.pr_details.outputs.base}} | ||
echo "targetCommitId=$targetId" >> $env:GITHUB_OUTPUT | ||
echo "source commit: $sourceId" | ||
echo "base commit: $baseId" | ||
echo "target commit: $targetId" | ||
Write-Output "targetCommitId=$targetId" >> $env:GITHUB_OUTPUT | ||
Write-Output "source commit: $sourceId" | ||
Write-Output "base commit: $baseId" | ||
Write-Output "target commit: $targetId" | ||
- name: Start merge | ||
run: | | ||
|
@@ -152,7 +152,7 @@ jobs: | |
$sha = ($pointer[1] -split(":"))[1] | ||
$shaPart1 = $sha.Substring(0,2) | ||
$shaPart2 = $sha.Substring(2,2) | ||
echo "Model SHA: $sha" | ||
Write-Output "Model SHA: $sha" | ||
git cat-file --filters ${{steps.CommitIds.outputs.targetCommitId}}:${{env.ModelName}}.${{env.ModelExtension}} | Out-Null | ||
copy ".git\lfs\objects\$shaPart1\$shaPart2\$sha" "${{env.ModelName}}_target.${{env.ModelExtension}}" | ||
|
@@ -163,7 +163,7 @@ jobs: | |
$sha = ($pointer[1] -split(":"))[1] | ||
$shaPart1 = $sha.Substring(0,2) | ||
$shaPart2 = $sha.Substring(2,2) | ||
echo "Model SHA: $sha" | ||
Write-Output "Model SHA: $sha" | ||
git cat-file --filters ${{steps.CommitIds.outputs.baseCommitId}}:${{env.ModelName}}.${{env.ModelExtension}} | Out-Null | ||
copy ".git\lfs\objects\$shaPart1\$shaPart2\$sha" "${{env.ModelName}}_base.${{env.ModelExtension}}" | ||
|
@@ -174,7 +174,7 @@ jobs: | |
$sha = ($pointer[1] -split(":"))[1] | ||
$shaPart1 = $sha.Substring(0,2) | ||
$shaPart2 = $sha.Substring(2,2) | ||
echo "Model SHA: $sha" | ||
Write-Output "Model SHA: $sha" | ||
git cat-file --filters ${{steps.CommitIds.outputs.sourceCommitId}}":${{env.ModelName}}.${{env.ModelExtension}}" | Out-Null | ||
copy ".git\lfs\objects\$shaPart1\$shaPart2\$sha" "${{env.ModelName}}_head.${{env.ModelExtension}}" | ||
|
@@ -189,33 +189,33 @@ jobs: | |
id: mergeEA | ||
run: | | ||
&"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}" merge --base ${{env.ModelName}}_base.${{env.ModelExtension}} --theirs ${{env.ModelName}}_target.${{env.ModelExtension}} --mine ${{env.ModelName}}_head.${{env.ModelExtension}} --out merged.${{env.ModelExtension}} --abortOnConflict true | ||
echo "result=$LASTEXITCODE" >> $GITHUB_OUTPUT | ||
echo "Return code: $LASTEXITCODE" | ||
Write-Output "result=$LASTEXITCODE" >> $GITHUB_OUTPUT | ||
Write-Output "Return code: $LASTEXITCODE" | ||
if($LASTEXITCODE -eq 0){ | ||
echo "No merge conflicts, setting message" | ||
echo "message=:heavy_check_mark: Merge performed successfully" >> $env:GITHUB_OUTPUT | ||
Write-Output "No merge conflicts, setting message" | ||
Write-Output "message=:heavy_check_mark: Merge performed successfully" >> $env:GITHUB_OUTPUT | ||
} | ||
elseif($LASTEXITCODE -eq 2){ | ||
echo "::error::Internal Error when diffing. Please report such errors to [email protected]" | ||
echo ":message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" | ||
Write-Output "::error::Internal Error when diffing. Please report such errors to [email protected]" | ||
Write-Output ":message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" | ||
} | ||
elseif($LASTEXITCODE -eq 3){ | ||
echo "Merge conflicts present, auto-merge failed" | ||
echo "message=:x: Merge conflicts present, auto-merge failed" >> $env:GITHUB_OUTPUT | ||
Write-Output "Merge conflicts present, auto-merge failed" | ||
Write-Output "message=:x: Merge conflicts present, auto-merge failed" >> $env:GITHUB_OUTPUT | ||
exit 0 | ||
} | ||
elseif($LASTEXITCODE -eq 6){ | ||
echo "::warning::Licensing issue of LemonTree.Automation" | ||
echo "message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
Write-Output "::warning::Licensing issue of LemonTree.Automation" | ||
Write-Output "message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
} | ||
else{ | ||
echo "::error::Unknown error" | ||
echo "message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
Write-Output "::error::Unknown error" | ||
Write-Output "message=:x: Merge failed, check [action log](${{env.GitHubProjectRoot}}/actions/runs/${{ github.run_id }}) for details" >> $env:GITHUB_OUTPUT | ||
} | ||
- name: Archive Model Files | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Model File Archive | ||
path: "*.eap*" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ jobs: | |
jsVar: ${{steps.linked_prs.outputs.result}} | ||
run: | | ||
$prList = $env:jsVar | ConvertFrom-Json | ||
echo "count=$($prList.length)" >> $env:GITHUB_OUTPUT | ||
Write-Output "count=$($prList.length)" >> $env:GITHUB_OUTPUT | ||
- uses: actions/checkout@v4 | ||
if: ${{ steps.checkNumber.outputs.count > 0}} | ||
|
@@ -72,34 +72,34 @@ jobs: | |
jsVar: ${{steps.linked_prs.outputs.result}} | ||
run: | | ||
#Create review session files for each pull requestReviewers | ||
echo "Starting process" | ||
Write-Output "Starting process" | ||
function getCommitIds($baseRef, $headRef) | ||
{ | ||
$ret =@{} | ||
$ret["baseId"] = git merge-base origin/$baseRef origin/$headRef | ||
$ret["sourceId"] = git show-ref --hash origin/$headRef | ||
$ret["targetId"] = git show-ref --hash origin/$baseRef | ||
echo "target branch: $baseRef" | ||
echo "source branch: $headRef" | ||
echo "target commit: $($ret.targetId)" | ||
echo "source commit: $($ret.sourceId)" | ||
echo "base commit: $($ret.baseId)" | ||
Write-Output "target branch: $baseRef" | ||
Write-Output "source branch: $headRef" | ||
Write-Output "target commit: $($ret.targetId)" | ||
Write-Output "source commit: $($ret.sourceId)" | ||
Write-Output "base commit: $($ret.baseId)" | ||
return $ret | ||
} | ||
function downloadFileVersion($fileName, $commitId) | ||
{ | ||
echo "Filename: $fileName@$commitId" | ||
Write-Output "Filename: $fileName@$commitId" | ||
#git fetch origin $commitId | ||
$pointer = git cat-file blob $commitId":"$fileName | ||
$sha = ($pointer[1] -split(":"))[1] | ||
echo "SHA: $sha" | ||
Write-Output "SHA: $sha" | ||
$shaPart1 = $sha.Substring(0,2) | ||
$shaPart2 = $sha.Substring(2,2) | ||
git cat-file --filters $commitId":"$fileName | Out-Null | ||
$targetFile = $fileName+"_"+$commitId | ||
copy ".git\lfs\objects\$shaPart1\$shaPart2\$sha" $targetFile | ||
echo "Version file: $targetFile" | ||
Write-Output "Version file: $targetFile" | ||
} | ||
function getSessionFileName($repoName, $prNumber, $sourceCommit, $targetCommit) | ||
|
@@ -113,19 +113,19 @@ jobs: | |
$modelFileName = "${{env.ModelName}}.${{env.ModelExtension}}" | ||
foreach($pr in $prList) | ||
{ | ||
echo "Processing PR $($pr.number)" | ||
Write-Output "Processing PR $($pr.number)" | ||
$commitIds = getCommitIds $pr.base.ref $pr.head.ref | ||
$sessionFileName = getSessionFileName ${{ github.repository }} $pr.number $commitIds.sourceId $commitIds.targetId | ||
echo "Session filename: $sessionFileName" | ||
Write-Output "Session filename: $sessionFileName" | ||
echo "Downloading base file" | ||
Write-Output "Downloading base file" | ||
downloadFileVersion $modelFileName $commitIds.baseId | ||
echo "Downloading source file" | ||
Write-Output "Downloading source file" | ||
downloadFileVersion $modelFileName $commitIds.sourceId | ||
echo "Downloading target file" | ||
Write-Output "Downloading target file" | ||
downloadFileVersion $modelFileName $commitIds.targetId | ||
echo "Starting check for merge conflicts" | ||
Write-Output "Starting check for merge conflicts" | ||
$baseFile = $modelFileName +"_"+$commitIds.baseId | ||
$targetFile = $modelFileName +"_"+$commitIds.targetId | ||
|
@@ -143,16 +143,16 @@ jobs: | |
if($LASTEXITCODE -eq 0) | ||
{ | ||
echo "No merge conflicts, update only on target branch. No new review session file required." | ||
Write-Output "No merge conflicts, update only on target branch. No new review session file required." | ||
} | ||
elseif($LASTEXITCODE -eq 2) | ||
{ | ||
echo "Internal Error when diffing. Please report such errors to [email protected]" | ||
Write-Output "Internal Error when diffing. Please report such errors to [email protected]" | ||
} | ||
elseif($LASTEXITCODE -eq 3) | ||
{ | ||
echo "Merge conflicts" | ||
echo "Uploading $sessionFileName to Nexus: $targetUrl" | ||
Write-Output "Merge conflicts" | ||
Write-Output "Uploading $sessionFileName to Nexus: $targetUrl" | ||
while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest | ||
curl "-u${{secrets.NEXUSAUTHENTICATION}}" -T $sessionFileName $targetUrl | ||
$prMessage =@{} | ||
|
@@ -162,16 +162,16 @@ jobs: | |
} | ||
elseif($LASTEXITCODE -eq 6) | ||
{ | ||
echo "Licensing issue of LemonTree.Automation" | ||
Write-Output "Licensing issue of LemonTree.Automation" | ||
} | ||
else | ||
{ | ||
echo "Unknown error, exit code: $LASTEXITCODE" | ||
Write-Output "Unknown error, exit code: $LASTEXITCODE" | ||
} | ||
} | ||
$jsonResult = ConvertTo-Json -InputObject $messageList -Compress | ||
echo $jsonResult | ||
echo "result=$jsonResult" >> $env:GITHUB_OUTPUT | ||
Write-Output $jsonResult | ||
Write-Output "result=$jsonResult" >> $env:GITHUB_OUTPUT | ||
- name: CreateComments | ||
if: ${{ steps.checkNumber.outputs.count > 0}} | ||
|
Oops, something went wrong.