Skip to content

Commit

Permalink
Update pr-commands.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
TanguyBarthelemy authored Apr 5, 2024
1 parent b2bbb83 commit 7a379b7
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,29 @@ jobs:
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
- name: Config git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
# Check if there are any changes
- name: Check for changes
id: check_changes
run: |
git diff --exit-code --quiet --name-only -- NAMESPACE man/ || echo "Changes detected"
- name: Commit the changes
if: steps.check_changes.outputs.stdout == 'Changes detected'
run: |
git add man/\* NAMESPACE
git commit -m '[GHA] Document package'
# Commit changes or a placeholder commit if no changes
- name: Commit no changes
if: steps.check_changes.outputs.stdout != 'Changes detected'
run: |
git commit --allow-empty -m '[GHA] Package already documented'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -79,7 +95,6 @@ jobs:
- name: Set up for RProtoBuf
run: sudo apt-get update -y && sudo apt-get install protobuf-compiler libprotobuf-dev libprotoc-dev


- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}
Expand All @@ -88,13 +103,29 @@ jobs:
run: styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4))
shell: Rscript {0}

- name: commit
- name: Config git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
# Check if there are any changes
- name: Check for changes
id: check_changes
run: |
git diff --quiet \*.R || echo "Changes detected"
- name: Commit the changes
if: steps.check_changes.outputs.stdout == 'Changes detected'
run: |
git add \*.R
git commit -m '[GHA] Style package'
# Commit changes or a placeholder commit if no changes
- name: Commit no changes
if: steps.check_changes.outputs.stdout != 'Changes detected'
run: |
git commit --allow-empty -m '[GHA] Package already styled'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7a379b7

Please sign in to comment.