From 27c652b21a59b264abe635dacca28ff4e2280b3e Mon Sep 17 00:00:00 2001 From: Daniel Siegl Date: Wed, 6 Nov 2024 11:18:34 +0100 Subject: [PATCH] [#223] Update depricated actions * changed echo to write-output * Updated Artifacts --- .github/workflows/ModelCheck.yml | 16 ++--- .github/workflows/RebasePrByComments.yml | 20 +++--- .github/workflows/TriggerMergeByComments.yml | 68 +++++++++---------- ...viewSessionFilesPullRequestsBaseCommit.yml | 48 ++++++------- .github/workflows/downloadPostCommitXmi.yml | 8 +-- .github/workflows/publishComponents.yml | 4 +- .github/workflows/publishReviewSession.yml | 62 ++++++++--------- .github/workflows/validateIncQuery.yml | 16 ++--- 8 files changed, 121 insertions(+), 121 deletions(-) diff --git a/.github/workflows/ModelCheck.yml b/.github/workflows/ModelCheck.yml index aed2e4d..41b5ed0 100644 --- a/.github/workflows/ModelCheck.yml +++ b/.github/workflows/ModelCheck.yml @@ -31,7 +31,7 @@ jobs: - name: Run LemonTree Check Tool id: modelcheck run: | - echo "starting validation" + Write-Output "starting validation" .\LemonTree.Pipeline.Tools.ModelCheck.exe --model "${{env.ModelName}}" --out ".\output.md" --FailOnErrors Get-Content "output.md" >> $env:GITHUB_STEP_SUMMARY @@ -45,8 +45,8 @@ jobs: # $Message = "output.md" - echo "modelcheckExitCode=$LASTEXITCODE" >> $env:GITHUB_OUTPUT - echo "finished validation with $LASTEXITCODE" + Write-Output "modelcheckExitCode=$LASTEXITCODE" >> $env:GITHUB_OUTPUT + Write-Output "finished validation with $LASTEXITCODE" #for now never stop exit 0 @@ -83,13 +83,13 @@ jobs: - name: evaulate Exit Code run: | - echo "set job failed on ..." - echo "Current Exit Code ${{ steps.modelcheck.outputs.modelcheckExitCode }}" + Write-Output "set job failed on ..." + Write-Output "Current Exit Code ${{ steps.modelcheck.outputs.modelcheckExitCode }}" if (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 1) { #fail on warning - Echo "model has at least one warning" + Write-Output "model has at least one warning" #fail on warning #exit 3 #ignore warning @@ -98,13 +98,13 @@ jobs: elseif (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 2) { #fail on Error - echo "model has at least one error" + Write-Output "model has at least one error" exit 2 } elseif (${{ steps.modelcheck.outputs.modelcheckExitCode }} -eq 0) { #brilliant model - Echo "modelcheck is passed" + Write-Output "modelcheck is passed" exit 0 } else diff --git a/.github/workflows/RebasePrByComments.yml b/.github/workflows/RebasePrByComments.yml index d8f494d..96cde72 100644 --- a/.github/workflows/RebasePrByComments.yml +++ b/.github/workflows/RebasePrByComments.yml @@ -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 support@lieberlieber.com" - 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 'support@lieberlieber.com' - 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 diff --git a/.github/workflows/TriggerMergeByComments.yml b/.github/workflows/TriggerMergeByComments.yml index bb7ee3b..f6987fe 100644 --- a/.github/workflows/TriggerMergeByComments.yml +++ b/.github/workflows/TriggerMergeByComments.yml @@ -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 support@lieberlieber.com" - 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 support@lieberlieber.com" + 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*" diff --git a/.github/workflows/UpdateReviewSessionFilesPullRequestsBaseCommit.yml b/.github/workflows/UpdateReviewSessionFilesPullRequestsBaseCommit.yml index 2fcd351..a0795d1 100644 --- a/.github/workflows/UpdateReviewSessionFilesPullRequestsBaseCommit.yml +++ b/.github/workflows/UpdateReviewSessionFilesPullRequestsBaseCommit.yml @@ -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 support@lieberlieber.com" + Write-Output "Internal Error when diffing. Please report such errors to support@lieberlieber.com" } 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}} diff --git a/.github/workflows/downloadPostCommitXmi.yml b/.github/workflows/downloadPostCommitXmi.yml index 9322468..34f60df 100644 --- a/.github/workflows/downloadPostCommitXmi.yml +++ b/.github/workflows/downloadPostCommitXmi.yml @@ -35,9 +35,9 @@ jobs: id: downloadXmi run: | $gitcommitId = git rev-parse origin/$env:GITHUB_HEAD_REF - Echo "git CommitId: $gitcommitId" + Write-Output "git CommitId: $gitcommitId" $url = "${{env.xmiURL}}&name=$gitcommitId*" - Echo $url + Write-Output $url $json = Invoke-RestMethod -Uri $url -Method Get foreach ($url in $json.items.assets.downloadUrl) { @@ -47,7 +47,7 @@ jobs: if($file.StartsWith($gitcommitId)) { - Echo "Download: $file" + Write-Output "Download: $file" $content = ((Invoke-WebRequest -Uri $url -Method Get) -replace "") [IO.File]::WriteAllLines($file, $content) @@ -56,7 +56,7 @@ jobs: exit 0 - name: Archive Session Files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Post Commit XMi path: ".\\*.xmi" #${{ steps.downloadXmi.outputs.result }} diff --git a/.github/workflows/publishComponents.yml b/.github/workflows/publishComponents.yml index 1f95ce6..8e8472b 100644 --- a/.github/workflows/publishComponents.yml +++ b/.github/workflows/publishComponents.yml @@ -45,7 +45,7 @@ jobs: # &"${{env.LemonTreeAutomationExecutable}}" import --Model ${{env.ComponentModelShortCut}} --Components "*.mpms" - name: Archive Session Files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Model Components path: "*.mpms" @@ -59,7 +59,7 @@ jobs: $sfName = $file.Name $sfNameUri = [uri]::EscapeDataString($sfName) $targetUrl = "${{env.ReviewSessionURL}}$sfNameUri" - echo "Uploading $sfName to Nexus: $targetUrl" + Write-Output "Uploading $sfName 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 ".\$sfName" "$targetUrl" } diff --git a/.github/workflows/publishReviewSession.yml b/.github/workflows/publishReviewSession.yml index eb6be6c..76b171e 100644 --- a/.github/workflows/publishReviewSession.yml +++ b/.github/workflows/publishReviewSession.yml @@ -38,16 +38,16 @@ jobs: run: | git fetch $baseId = git merge-base origin/$env:GITHUB_BASE_REF origin/$env:GITHUB_HEAD_REF - echo "::set-output name=baseCommitId::$baseId" + Write-Output "baseCommitId=$baseId" >> $env:GITHUB_OUTPUT $sourceId = git show-ref --hash origin/$env:GITHUB_HEAD_REF - echo "::set-output name=sourceCommitId::$sourceId" + Write-Output "sourceCommitId=$sourceId" >> $env:GITHUB_OUTPUT $targetId = git show-ref --hash origin/$env:GITHUB_BASE_REF - echo "::set-output name=targetCommitId::$targetId" - echo "target branch: $env:GITHUB_BASE_REF" - echo "source branch: $env:GITHUB_HEAD_REF" - echo "target commit: $targetId" - echo "source commit: $sourceId" - echo "base commit: $baseId" + Write-Output "targetCommitId=$targetId" >> $env:GITHUB_OUTPUT + Write-Output "target branch: $env:GITHUB_BASE_REF" + Write-Output "source branch: $env:GITHUB_HEAD_REF" + Write-Output "target commit: $targetId" + Write-Output "source commit: $sourceId" + Write-Output "base commit: $baseId" - name: Create sessionfile name id: session_file @@ -72,13 +72,13 @@ jobs: if($sha -ne $null){ $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}}" - echo "result=downloaded" >> $env:GITHUB_OUTPUT + Write-Output "result=downloaded" >> $env:GITHUB_OUTPUT } else{ - echo "result=notFound" >> $env:GITHUB_OUTPUT + Write-Output "result=notFound" >> $env:GITHUB_OUTPUT } - name: Post new model comment to PR @@ -102,7 +102,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}}" @@ -118,26 +118,26 @@ jobs: id: mergeCheck run: | &"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}" merge --base ${{env.ModelName}}_base.${{env.ModelExtension}} --theirs ${{env.ModelName}}.${{env.ModelExtension}} --mine ${{env.ModelName}}_head.${{env.ModelExtension}} --dryrun --sfs ${{ steps.session_file.outputs.result }} --abortOnConflict true - echo "::set-output name=result::$LASTEXITCODE" - echo "Return code: $LASTEXITCODE" + Write-Output "result=$LASTEXITCODE" >> $env:GITHUB_OUTPUT + Write-Output "Return code: $LASTEXITCODE" if($LASTEXITCODE -eq 0){ - echo "No merge conflicts, setting message" - echo "message=[Review Session file](${{env.ReviewSessionURL}}/${{ steps.session_file.outputs.result }})\n:heavy_check_mark: **No merge conflicts in model**\n\nInstall [LemonTree 3.3+](https://www.lieberlieber.com/lemontree/en/) to open the Review Session file." >> $env:GITHUB_OUTPUT + Write-Output "No merge conflicts, setting message" + ecWrite-Outputho "message=[Review Session file](${{env.ReviewSessionURL}}/${{ steps.session_file.outputs.result }})\n:heavy_check_mark: **No merge conflicts in model**\n\nInstall [LemonTree 3.3+](https://www.lieberlieber.com/lemontree/en/) to open the Review Session file." >> $env:GITHUB_OUTPUT } elseif($LASTEXITCODE -eq 2){ - echo "Internal Error when diffing. Please report such errors to support@lieberlieber.com" + Write-Output "Internal Error when diffing. Please report such errors to support@lieberlieber.com" exit 2 } elseif($LASTEXITCODE -eq 3){ - echo "Merge conflicts, setting message" - echo "message=[Review Session file](${{env.ReviewSessionURL}}/${{ steps.session_file.outputs.result }})\n:x: **Please resolve merge conflicts in model first**\n\nInstall [LemonTree 3.3+](https://www.lieberlieber.com/lemontree/en/) to open the Review Session file." >> $env:GITHUB_OUTPUT + Write-Output "Merge conflicts, setting message" + Write-Output "message=[Review Session file](${{env.ReviewSessionURL}}/${{ steps.session_file.outputs.result }})\n:x: **Please resolve merge conflicts in model first**\n\nInstall [LemonTree 3.3+](https://www.lieberlieber.com/lemontree/en/) to open the Review Session file." >> $env:GITHUB_OUTPUT exit 0 } elseif($LASTEXITCODE -eq 6){ - echo "Licensing issue of LemonTree.Automation" + Write-Output "Licensing issue of LemonTree.Automation" } else{ - echo "Unknown error" + Write-Output "Unknown error" } # - name: Remove DIAGRAMIMAGEMAPS for Diff @@ -145,9 +145,9 @@ jobs: # run: | # while (Test-Path Alias:curl) {Remove-Item Alias:curl} #remove the alias binding from curl to Invoke-WebRequest # curl "${{env.LemonTreePipelineToolsRemovePrerenderedDiagramsExecutable}}" --output LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe - # echo ".\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_base.${{env.ModelExtension}}" + # Write-Output ".\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_base.${{env.ModelExtension}}" # .\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_base.${{env.ModelExtension}} - # echo ".\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_head.${{env.ModelExtension}}" + # Write-Output ".\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_head.${{env.ModelExtension}}" # .\LemonTree.Pipeline.Tools.RemovePrerenderedDiagrams.exe remove --Model ${{env.ModelName}}_head.${{env.ModelExtension}} - name: Create review session file @@ -159,20 +159,20 @@ jobs: if ($mergecheckresult -eq 0) { $output = &'${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}' diff --theirs ${{env.ModelName}}_base.${{env.ModelExtension}} --mine ${{env.ModelName}}_head.${{env.ModelExtension}} --sfs ${{ steps.session_file.outputs.result }} - echo $output + Write-Output $output ForEach ($line in $($output -split "`r`n")) { if ($line.EndsWith('Found 0 different elements.')) { - echo "No differences we don't need to publish the session file." + Write-Output "No differences we don't need to publish the session file." $Message = ":heavy_check_mark: **Model is identical!**" $sfsfilename =""; } } } - echo "$Message" - echo "SfsFileName=$sfsfilename" >> $env:GITHUB_OUTPUT - echo "message=$Message" >> $env:GITHUB_OUTPUT + Write-Output "$Message" + Write-Output "SfsFileName=$sfsfilename" >> $env:GITHUB_OUTPUT + Write-Output "message=$Message" >> $env:GITHUB_OUTPUT exit 0 - name: Upload @@ -181,19 +181,19 @@ jobs: $sessionFileName = "${{ steps.checkSession.outputs.SfsFileName }}" if ([string]::IsNullOrEmpty($sessionFileName)) { - echo "Nothing to upload" + Write-Output "Nothing to upload" } else { $targetUrl = "${{env.ReviewSessionURL}}/${{ steps.session_file.outputs.result }}" - echo "Uploading $sessionFileName to Nexus: $targetUrl" + 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 } - name: Archive Session Files if: steps.baseDownload.outputs.result == 'downloaded' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Review Session File path: ${{ steps.session_file.outputs.result }} diff --git a/.github/workflows/validateIncQuery.yml b/.github/workflows/validateIncQuery.yml index 4bf0608..8f72173 100644 --- a/.github/workflows/validateIncQuery.yml +++ b/.github/workflows/validateIncQuery.yml @@ -40,14 +40,14 @@ jobs: - name: Run SysML Check Tool id: sysmlCheck run: | - echo "starting validation" + Write-Output "starting validation" #.\ea-iqs\Com.Incquerylabs.Incquery.Connector.Cli.exe -i "${{secrets.IQSVALIDATIONSERVER}}" --sso -u "${{secrets.IQSUSER}}" -p "${{secrets.IQSPWD}}" -o "output.md" -c "${{env.ModelName}}.${{env.ModelExtension}}" .\ea-iqs\assemblies\IncQueryServer.EA.Connector.DemoWorkflow.exe -i "${{secrets.IQSVALIDATIONSERVER}}" --sso -u "${{secrets.IQSUSER}}" -p "${{secrets.IQSPWD}}" -o "output.md" -m "${{env.ModelName}}.${{env.ModelExtension}}" type "output.md" - echo "finished validation with $LASTEXITCODE" + Write-Output "finished validation with $LASTEXITCODE" # Exit codes of the CLI application: # * 0 = model is valid (no error, no warning, no runtime exception) @@ -58,7 +58,7 @@ jobs: $Message = "output.md" - echo "ValidationExitCode=$($LASTEXITCODE)" >> $env:GITHUB_OUTPUT + Write-Output "ValidationExitCode=$($LASTEXITCODE)" >> $env:GITHUB_OUTPUT #for now never stop exit 0 @@ -95,8 +95,8 @@ jobs: - name: evaulate Exit Code run: | - echo "set job failed on ..." - echo "Current Exit Code ${{ steps.sysmlCheck.outputs.ValidationExitCode }}" + Write-Output "set job failed on ..." + Write-Output "Current Exit Code ${{ steps.sysmlCheck.outputs.ValidationExitCode }}" # Exit codes of the CLI application: # * 0 = model is valid (no error, no warning, no runtime exception) @@ -108,7 +108,7 @@ jobs: if (${{ steps.sysmlCheck.outputs.ValidationExitCode }} -eq 3) { #fail on warning - Echo "model has at least one warning" + Write-Output "model has at least one warning" #fail on warning #exit 3 #ignore warning @@ -117,13 +117,13 @@ jobs: elseif (${{ steps.sysmlCheck.outputs.ValidationExitCode }} -eq 4) { #fail on Error - echo "model has at least one error" + Write-Output "model has at least one error" exit 4 } elseif (${{ steps.sysmlCheck.outputs.ValidationExitCode }} -eq 0) { #brilliant model - Echo "model is valid" + Write-Output "model is valid" exit 0 } else