From 2a066b51017ee649b280417c757db2aacaa302d7 Mon Sep 17 00:00:00 2001 From: Jean Cochrane Date: Tue, 28 May 2024 13:41:39 -0500 Subject: [PATCH] Fix file permissions error in `style-files` pre-commit hook (#49) * Fix file permissions error in `style-files` pre-commit hook by requiring serial execution * Switch to ccao-data/actions/pre-commit action in pre-commit workflow * Temporarily pin pre-commit action to time-pre-commit branch * Revert "Fix file permissions error in `style-files` pre-commit hook by requiring serial execution" This reverts commit f079810997e3a0e9027ead6ff30e2b88f9d55681. * Reapply "Fix file permissions error in `style-files` pre-commit hook by requiring serial execution" This reverts commit bc23e2d3520c45289edd55ebb7c1e39575689c9e. * Revert "Temporarily pin pre-commit action to time-pre-commit branch" This reverts commit f572f30ce59dff5199cc80bb487e092688606f69. --- .github/workflows/pre-commit.yaml | 28 +++------------------------- .pre-commit-config.yaml | 3 ++- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 51ff54d..f1b6fd2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -10,29 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: 3.x - - - name: Install pre-commit - run: python -m pip install pre-commit - shell: bash - - - name: Freeze dependencies - run: python -m pip freeze --local - shell: bash - - - name: Cache pre-commit environment - uses: actions/cache@v3 - with: - path: | - ~/.cache/pre-commit - ~/.cache/R - key: pre-commit-3-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Run pre-commit - run: pre-commit run --show-diff-on-failure --color=always --all-files - shell: bash + - name: Run pre-commit checks + uses: ccao-data/actions/pre-commit@main diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 58c9364..7a998d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,7 @@ repos: hooks: - id: style-files args: [--style_pkg=styler, --style_fun=tidyverse_style] + require_serial: true - id: lintr - id: readme-rmd-rendered exclude: reports/README.md @@ -25,4 +26,4 @@ repos: name: Don't commit common R artifacts entry: Cannot commit .Rhistory, .RData, .Rds or .rds. language: fail - files: '\.(Rhistory|RData|Rds|rds)$' \ No newline at end of file + files: '\.(Rhistory|RData|Rds|rds)$'