Skip to content

Commit

Permalink
Update check.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
killianogorman authored Jun 8, 2024
1 parent 4aa8c64 commit f6bd977
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ name: Check Markdown and Text files for profanity

on:
push:
branches:
- main
paths:
- '**/*.md'
- '**/*.mdx'
- '**/*.json'
- 'README'
- '**/*.toml'
- "**/*.md"
- "**/*.mdx"
- "**/*.json"
- "**/*.yml"
branches:
- published

jobs:
setup_environment:
check_profanity:
runs-on: ubuntu-latest
name: Set up Environment
name: Test Changed Files for Profanity
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -24,45 +23,36 @@ jobs:
with:
toolchain: stable
override: true

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

get_changed_files:
runs-on: ubuntu-latest
name: Get Changed Files
steps:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed files: ${ALL_CHANGED_FILES}"
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
run_profanity_check:
needs: [setup_environment, get_changed_files]
runs-on: ubuntu-latest
name: Run Profanity Check
steps:
- name: Install rust dependencies & build
run: |
cargo build --release
- name: Run Profanity Check
env:
ALL_CHANGED_FILES: ${{ needs.get_changed_files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "Checking file: $file"
Expand Down

0 comments on commit f6bd977

Please sign in to comment.