Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/style-and-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main, master]
branches: [not-main, not-master]

name: style-and-lint

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/style-with-air.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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-with-air

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 Air
run: nix-shell -I nixpkgs='https://github.com/rstats-on-nix/nixpkgs/archive/2025-02-28.tar.gz' -p air-formatter --run "air format ."

- 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 }}
Loading