'Saving excel file from a Python script running in a Docker container in Jenkins

I have a script.py producing an excel file running on a Docker container in a Jenkins pipeline.

Jenkins pulls the code from GitHub and the code runs fine except the resulting excel file is not saved anywhere.

Is there a way to write the excel file back into the Git repo so the file can be retrieved later on ?

Here is the pipeline:

pipeline {
    agent {
        label 'shared-redhat'
    }

    stages {
        stage('Parallel'){
            parallel {
                stage('Dependency install') {
                    agent {
                        docker {
                            label 'shared-redhat'
                            image 'jenkins/slaves/python:3.6'
                            registryUrl 'url'
                        }
                    }
                    steps {
                        sh 'pip install -r requirements.txt'
                        sh 'python scritp.py'
                    }
                }
                
                stage('Do something else') {
                    steps {
                        sh 'python -V'
                    }
                }
            }
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source