check-cran-deadline #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '42 1 * * *' | |
name: check-cran-deadline | |
jobs: | |
fetch-deadlines: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
issues: write | |
actions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: gh | |
- name: Fetch deadline for this package | |
shell: Rscript {0} | |
run: | | |
crandb <- tools::CRAN_package_db() | |
deadline <- crandb[Package == "pavo", "Deadline"] | |
if (!is.na(deadline)) { | |
gh::gh( | |
"POST /repos/{owner}/{repo}/issues", | |
owner = "rmaia", | |
repo = "pavo", | |
title = paste("Fix CRAN R CMD check issues by", deadline), | |
body = "This GHA workflow has been disabled. Please re-enable it when closing this issue." | |
) | |
gh::gh( | |
"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable", | |
owner = "rmaia", | |
pavo = "pavo", | |
workflow_id = "check-cran-deadline.yaml" | |
) | |
} |