Skip to content

Commit

Permalink
[#223] Update depricated actions
Browse files Browse the repository at this point in the history
* changed echo to write-output
* Updated Artifacts
  • Loading branch information
danielsiegl committed Nov 6, 2024
1 parent 6e588a5 commit 27c652b
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 121 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ModelCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/RebasePrByComments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
68 changes: 34 additions & 34 deletions .github/workflows/TriggerMergeByComments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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: |
Expand All @@ -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}}"
Expand All @@ -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}}"
Expand All @@ -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}}"
Expand All @@ -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*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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 =@{}
Expand All @@ -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}}
Expand Down
Loading

0 comments on commit 27c652b

Please sign in to comment.