diff --git a/.github/workflows/validation-release.yml b/.github/workflows/validation-release.yml new file mode 100644 index 0000000..56564d5 --- /dev/null +++ b/.github/workflows/validation-release.yml @@ -0,0 +1,40 @@ +--- +name: R Package Validation report + +on: # Run this action when a release is published + release: + types: [published] + +jobs: + r-pkg-validation: + name: Create report 📃 + runs-on: ubuntu-latest + # Set Github token permissions + permissions: + contents: write + packages: write + deployments: write + steps: + - name: Checkout repo 🛎 + uses: actions/checkout@v2 + + - name: Build report 🏗 + uses: insightsengineering/thevalidatoR@main + with: + # R package root path, in case your R package is within a subdirectory of the repo + report_pkg_dir: "." + # Template location + report_template_path: ".github/validation_template.rmd" + # Report format - provided to `rmarkdown::render` `output_format` + report_rmarkdown_format: "pdf_document" + + # Upload the validation report to the release + - name: Upload report to release 🔼 + if: success() + uses: svenstaro/upload-release-action@v2 + with: + file: ./validation-report.pdf + asset_name: validation-report.pdf + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} + overwrite: false