Github status checks on Jenkins DSL pipeline

I am trying to migrate my Jenkins freestlye job to pipeline. In the post build action i am using

publish coverage to GitHub
where 
Jacoco coverage counter type as Instruction  
Publish result as comment.

Now i am trying to do same from Jenkins pipeline.

post {
        success {
            jacoco(
                execPattern: '**/**.exec',
                classPattern: '**/classes',
                sourcePattern: '**/src/main/java',
                exclusionPattern: '',
                inclusionPattern: '**/*.java,**/*.groovy,**/*.kt,**/*.kts'
            )
            script {
                 step([$class: 'MasterCoverageAction', 
                 jacocoCounterType: 'INSTRUCTION',
                 publishResultAs: 'COMMENT'
                 ])
            }
        }
    }

But seeing errot as this.

WARNING: Unknown parameter(s) found for class type 'com.github.terma.jenkins.githubprcoveragestatus.MasterCoverageAction': publishResultAs
[Pipeline] }
[Pipeline] // script
Error when executing success post condition:
java.lang.UnsupportedOperationException: Can't find GIT_URL or CHANGE_URL in envs

I can see GIT_URL was set as gloabal variable in freestyle job but in pipeline even though i am passing from Jenkins it is not recognising GIT_URL.

environment {
        SKIP_SONAR = false // Default to false
        GIT_URL = "https://github.com/test/test.git"
    }
    stages {
        stage('Debug') {
            steps {
                script {
                    'sh printenv'
                    def gitUrl = env.GIT_URL
                    echo "Automatically set GIT_URL: ${gitUrl}"
                }
            }
        }

I am able to fix issue by myself. With this it is able to publish the code to github.

    post {
        success {
            jacoco(
                execPattern: '**/**.exec',
                classPattern: '**/classes',
                sourcePattern: '**/src/main/java',
                exclusionPattern: '',
                inclusionPattern: '**/*.java,**/*.groovy,**/*.kt,**/*.kts'
            )
            script {
                 step([$class: 'CompareCoverageAction', 
                 jacocoCounterType: 'INSTRUCTION',
                 publishResultAs: 'COMMENT',
                 scmVars: [GIT_URL: env.GIT_URL]
                 ])
            }
        }
    }

How ever still i am seeing warning.
WARNING: Unknown parameter(s) found for class type ‘com.github.terma.jenkins.githubprcoveragestatus.CompareCoverageAction’: jacocoCounterType

Good too see that it works now.

Please note that you are using the deprecated JaCoCo plugin: publishing code coverage results is now provided by the Coverage Plugin. It has built-in support to publish the results to GitHub.