Skip to content

Keeping track of fetched packages and commits to avoid duplicates and make fetching remotes faster #261

Keeping track of fetched packages and commits to avoid duplicates and make fetching remotes faster

Keeping track of fetched packages and commits to avoid duplicates and make fetching remotes faster #261

Workflow file for this run

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main, master]
name: style-and-lint
permissions: write-all
jobs:
style_pkg:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v15
with:
name: rstats-on-nix
- name: Build dev env
run: nix-build
- name: Run styler::style_pkg
run: nix-shell --run "Rscript -e 'styler::style_pkg()'"
- name: Run lintr
run: nix-shell --run "Rscript -e 'lintr::lint_package()'"
env:
LINTR_ERROR_ON_LINT: true
- name: config bot user and check for changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git diff-index --quiet HEAD || echo "has_changes=true" >> $GITHUB_ENV
- name: commit if changes
if: env.has_changes == 'true'
run: |
git add \*.R
git add \*.Rmd
git commit -m 'Style via {styler}'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}