@@ -698,6 +698,37 @@ void getAbsolutePathToOriginalPom_returns_the_original_pom_when_available() thro
698698 .containsOnly (originalPom .getAbsolutePath ());
699699 }
700700
701+ @ Test
702+ void shouldIncludeGithubActionFolder () throws Exception {
703+ File baseDir = temp .toAbsolutePath ().toFile ();
704+ File githubDir = new File (baseDir , ".github" );
705+ githubDir .mkdirs ();
706+ MavenProject project = createProject (new Properties (), "jar" );
707+
708+ Map <String , String > props = projectConverter .configure (Collections .singletonList (project ), project , new Properties ());
709+ assertThat (props ).containsEntry ("sonar.projectKey" , "com.foo:myProject" )
710+ .containsEntry ("sonar.projectName" , "My Project" )
711+ .containsEntry ("sonar.projectVersion" , "2.1" );
712+ assertThat (props .get ("sonar.sources" ).split ("," )).containsExactly (
713+ new File (baseDir , "pom.xml" ).getAbsolutePath (),
714+ githubDir .getAbsolutePath ()
715+ );
716+ }
717+
718+ @ Test
719+ void shouldNotIncludeGithubActionFolderWhenNotPresent () throws Exception {
720+ File baseDir = temp .toAbsolutePath ().toFile ();
721+ MavenProject project = createProject (new Properties (), "jar" );
722+
723+ Map <String , String > props = projectConverter .configure (Collections .singletonList (project ), project , new Properties ());
724+ assertThat (props ).containsEntry ("sonar.projectKey" , "com.foo:myProject" )
725+ .containsEntry ("sonar.projectName" , "My Project" )
726+ .containsEntry ("sonar.projectVersion" , "2.1" );
727+ assertThat (props .get ("sonar.sources" ).split ("," )).containsExactly (
728+ new File (baseDir , "pom.xml" ).getAbsolutePath ()
729+ );
730+ }
731+
701732 private MavenProject createProject (Properties pomProps , String packaging ) throws IOException {
702733 File pom = temp .resolve ("pom.xml" ).toFile ();
703734 pom .createNewFile ();
0 commit comments