Esempio n. 1
0
        protected override bool ShouldScanFileCore(CandidateFileContext context)
        {
            // https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows
            if (context.FileName.EndsWith(".yml", StringComparison.Ordinal) || context.FileName.EndsWith(".yaml", StringComparison.Ordinal))
            {
                var directoryName = Path.GetFileName(context.Directory);
                if (directoryName.Equals("workflows", StringComparison.Ordinal))
                {
                    directoryName = Path.GetFileName(Path.GetDirectoryName(context.Directory));
                    if (directoryName.Equals(".github", StringComparison.Ordinal))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Esempio n. 2
0
 protected override bool ShouldScanFileCore(CandidateFileContext context)
 {
     // The behavior should be handled by the base class with the FilePatterns property
     return(false);
 }
Esempio n. 3
0
 public override bool ShouldScanFile(CandidateFileContext file) => false;
Esempio n. 4
0
 protected override bool ShouldScanFileCore(CandidateFileContext context)
 {
     return(context.FileName.Equals("global.json", StringComparison.Ordinal));
 }
 protected override bool ShouldScanFileCore(CandidateFileContext file) => throw new InvalidOperationException();
 protected override bool ShouldScanFileCore(CandidateFileContext file) => true;