-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #766 from AlexsLemonade/jashapiro/765-action-new-d…
…ocker Update actions to use new Docker images and spellcheck
Showing
4 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
|
||
name: Spell check R Markdown and Markdown files | ||
|
||
# Controls when the action will run. | ||
# Pull requests to master only. | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
concurrency: | ||
# only one run per branch at a time | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# This workflow contains a single job called "spell check" | ||
spell-check: | ||
spellcheck: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rocker/tidyverse:4.2.3 | ||
name: Spell check files | ||
permissions: | ||
contents: read | ||
issues: write | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install packages | ||
run: Rscript --vanilla -e "install.packages(c('spelling'), repos = c(CRAN = '$CRAN'))" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run spell check | ||
id: spell_check_run | ||
run: | | ||
results=$(Rscript --vanilla "scripts/spell-check.R") | ||
echo "sp_chk_results=$results" >> $GITHUB_OUTPUT | ||
cat spell_check_errors.tsv | ||
- name: Spell check action | ||
uses: alexslemonade/spellcheck@v0 | ||
id: spell | ||
with: | ||
dictionary: components/dictionary.txt | ||
|
||
- name: Archive spelling errors | ||
uses: actions/upload-artifact@v3 | ||
- name: Upload spell check errors | ||
uses: actions/upload-artifact@v4 | ||
id: artifact-upload-step | ||
with: | ||
name: spell-check-results | ||
name: spell_check_errors | ||
path: spell_check_errors.tsv | ||
|
||
# If there are too many spelling errors, this will stop the workflow | ||
- name: Check spell check results - fail if too many errors | ||
if: ${{ steps.spell_check_run.outputs.sp_chk_results > 0 }} | ||
run: exit 1 | ||
- name: Fail if there are spelling errors | ||
if: steps.spell.outputs.error_count > 0 | ||
run: | | ||
echo "There were ${{ steps.spell.outputs.error_count }} errors" | ||
column -t spell_check_errors.tsv | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters