on: workflow_dispatch: inputs: r-version: description: "The version of R to use" default: "release" required: false type: choice options: - release workflow_call: inputs: r-version: description: "The version of R to use" default: "release" required: false type: string install-package: description: "Should the package be installed?" required: false default: false type: boolean name: Man Pages concurrency: group: roxygen-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: man: name: Roxygen runs-on: ubuntu-latest if: > !contains(github.event.commits[0].message, '[skip man]') env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: pharmaverse/admiralci/.github/actions/setup_R@main with: extra-packages: any::roxygen2 install-package: ${{ inputs.install-package }} - name: Generate man Pages run: | # Generate man Pages cat("Using roxygen2 version", packageVersion("roxygen2") |> as.character(), "\n") roxygen2::roxygenize('.') shell: Rscript {0} - name: Set-up safe dir run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" shell: bash - name: Roxygen check if: "!startsWith(github.event.comment.body, '/roxygenize')" run: | git status -s if [[ -n `git status -s | grep -E "man|DESCRIPTION"` ]] then { ROXYGEN_VERSION="$(Rscript -e 'packageVersion("roxygen2")' | awk '{print $NF}')" echo "šŸ™ˆ Manuals are not up-to-date with roxygen comments!" echo "šŸ”€ The following differences were noted:" git diff man/* DESCRIPTION echo -e "\nšŸ’» Please rerun the following command on your workstation and push your changes" echo "-------------------------" echo "roxygen2::roxygenize('.')" echo "-------------------------" echo "ℹ roxygen2 version that was used in this workflow: $ROXYGEN_VERSION" echo "šŸ™ Please ensure that the 'RoxygenNote' field in the DESCRIPTION file matches this version" exit 1 } else { echo "šŸ’š Manuals are up-to-date with roxygen comments" } fi shell: bash