Question Github Action lint

Plus d'informations
il y a 1 an 7 mois #32610 par Laurent Dardenne
Une tâche (Invokebuild) de vérification de la syntaxe d'une déclaration .yml :
task Actionlint {
# Linting all workflow files only in  .\.github\workflows directory

 if (Get-Command gh.exe)
 {
    $isActionLintExist=(gh extension list|Where-Object {$_ -match 'actionlint'}|Select-Object -first 1) -ne $null
    if (-not $isActionLintExist)
    { Throw "Github Cli: 'actionlint' extension not found. Use : gh extension install cschleiden/gh-actionlint"}

    $ActionLintErrors=gh actionlint -format '{{json .}}'|ConvertFrom-Json
    $ExitCode=$LastExitCode
    if ($ExitCode -ne 0)
    {
      $ErrorFiles=$ActionLintErrors|Group-Object filepath
      $ofs=' , '
      gh actionlint
      Throw "One or more Github Action lint errors were found : $($ErrorFiles.Name). Build cannot continue."
    }
 }
 else
 { Throw 'gh.exe (Github Cli) not found. See https://cli.github.com/'}
}

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.069 secondes
Propulsé par Kunena