Skip to content

Commit

Permalink
Create check-cran-deadline GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Nov 8, 2024
1 parent e2ee99b commit 4f88b74
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/check-cran-deadline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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"
)
}

0 comments on commit 4f88b74

Please sign in to comment.