Skip to content

Commit 4934943

Browse files
authored
Add support for repo/ref inputs (#8)
1 parent 1ef9331 commit 4934943

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/recheck.yml

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ on:
1313
required: false
1414
type: string
1515
default: ''
16+
repository:
17+
description: Repository to checkout (as owner/repo)
18+
required: false
19+
type: string
20+
default: ''
21+
ref:
22+
description: The branch, tag or SHA to checkout
23+
required: false
24+
type: string
25+
default: ''
1626

1727
env:
1828
R_LIBS_USER: ${{github.workspace}}/pkglib
@@ -40,6 +50,8 @@ jobs:
4050
- name: checkout
4151
uses: actions/checkout@v4
4252
with:
53+
repository: ${{ inputs.repository }}
54+
ref: ${{ inputs.ref }}
4355
path: source
4456

4557
- name: Set package source directory

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Then trigger it manually using the 'run workflow' button under the actions tab.
3333
3434
A summary of the results can be seen in the GHA webUI. Upon completion, the full install/check logs for all packages are available in the 'artifacts' section.
3535
36+
See [Advanced Usage](#advanced-usage) for information on additional workflow arguments recheck supports.
37+
3638
## Real world example
3739
3840
See here for an example using the V8 package: https://github.com/jeroen/V8/actions/workflows/recheck.yaml
@@ -59,3 +61,41 @@ CRAN runs revdep checks on `r-devel` on a server with `debian:testing` but there
5961

6062
On GitHub actions we run the check inside the [rcheckserver](https://github.com/r-devel/rcheckserver)
6163
container. This container has the same system libraries installed as the CRAN Debian server.
64+
65+
## Advanced Usage
66+
67+
By default, recheck runs against the package in the current repository.
68+
For some use cases, it may be useful to run recheck against a repository other than the current one and/or against a branch other than the default.
69+
70+
This can be achieved through a combination of the `repo` and `ref` parameters:
71+
72+
- `repo`: Repository to checkout (as `owner/repo`)
73+
- `ref`: The branch, tag or SHA to checkout
74+
75+
See the following example to get an idea of what this can look like:
76+
77+
```yml
78+
on:
79+
workflow_dispatch:
80+
inputs:
81+
which:
82+
type: choice
83+
description: Which dependents to check
84+
options:
85+
- strong
86+
- most
87+
88+
name: Reverse dependency check
89+
90+
jobs:
91+
revdep_check:
92+
name: Reverse check ${{ inputs.which }} dependents
93+
uses: r-devel/recheck/.github/workflows/recheck.yml@v1
94+
with:
95+
which: ${{ inputs.which }}
96+
subdirectory: 'r'
97+
repo: user/package_name
98+
ref: my_branch
99+
```
100+
101+
The above workflow runs recheck on the `my_branch` branch of a clone of https://github.com/user/package_name.

0 commit comments

Comments
 (0)