Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: commit all changed files by document workflow #694

Merged
merged 2 commits into from
Apr 1, 2023

Conversation

dpprdan
Copy link
Contributor

@dpprdan dpprdan commented Jan 18, 2023

Similar to #693 there are files missing in the https://github.com/r-lib/actions/blob/v2-branch/examples/document.yaml workflow. I.e. not all files which are affected by roxygen2::roxygenise() both as input and output are covered by the workflow.

One file that comes to mind is DESCRIPTION (Collate: and RoxygenNote: fields), which this PR adds to git add.

I am not entirely sure which other files are affected, but I suspect @gaborcsardi to know. 😄

I guess at least src/*.cpp should be watched for changes and R/RcppExports.R be git added as well? Anything else?

@gaborcsardi
Copy link
Member

I don't think that there are other files, but for advanced usage we could have an input parameter to add more files.

@dpprdan
Copy link
Contributor Author

dpprdan commented Jan 19, 2023

we could have an input parameter to add more files

Sorry, I don't follow. 😬 Do you have an example of what you mean by that?

Given that only a fraction of packages use Rcpp (either because they don't use C++ code or use cpp11), I'd just add DESCRIPTION now and maybe add an instruction to the README like "if your package uses Rcpp, add src/*.cpp here and R/RcppExports.R here".

@gaborcsardi
Copy link
Member

Sorry, I don't follow. 😬 Do you have an example of what you mean by that?

I mean adding an input parameter to the action, so if somebody generates more files with roxygenize() and they want to commit them, they can.

@dpprdan
Copy link
Contributor Author

dpprdan commented Jan 19, 2023

adding an input parameter to the action

I still don't follow 🙁. Both the "Document" as well as the "Commit and push changes" steps are just run steps and don't use actions proper for which one could define an input parameter (AFAIU).

In other words, how would one add an input parameter to a run step here?

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}
- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add man/\* NAMESPACE
git commit -m "Update documentation" || echo "No changes to commit"
git pull --ff-only
git push origin

Since I don't seem up to the task, maybe just merge this and add what you have in mind later? 🤷🏻‍♂️

@dpprdan dpprdan marked this pull request as ready for review January 19, 2023 09:33
@gaborcsardi
Copy link
Member

Right, never mind then, people can just add their own git add steps.

@codecov-commenter
Copy link

Codecov Report

Merging #694 (232debf) into v2-branch (33f03a8) will not change coverage.
The diff coverage is n/a.

❗ Current head 232debf differs from pull request most recent head f7f389b. Consider uploading reports for the commit f7f389b to get more accurate results

@@             Coverage Diff             @@
##           v2-branch      #694   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
===========================================
  Files              2         2           
  Lines             10        10           
===========================================
  Hits              10        10           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

dpprdan added a commit to dpprdan/opencage that referenced this pull request Jan 19, 2023
@gaborcsardi
Copy link
Member

Thanks1

@gaborcsardi gaborcsardi merged commit c4d9579 into r-lib:v2-branch Apr 1, 2023
@dpprdan dpprdan deleted the fix/commit_documented_files branch April 1, 2023 14:52
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants