Skip to content

test rb

test rb #13

Workflow file for this run

name: Check Typos in Pull Request
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
run: |
set -e
git fetch --all
current_commit=${{ github.event.pull_request.head.sha || github.sha }}
changed_files=$(git show --pretty="" --name-only $current_commit || true)
echo "Changed files: $changed_files"
echo "$changed_files" | tr ' ' '\n' > changed_files.txt
echo "CHANGED_FILE_LIST=changed_files.txt" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.14.0-alpha.1'
- name: Install typos
run: |
python3 -m pip install --upgrade pip
pip install typos
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Axios via npm
run: npm install axios
- name: Check typos in changed files and comment on PR
run: |
set -e
while IFS= read -r file; do
typos_output=$(typos "$file" --format brief 2>&1) || true
if [[ -n "$typos_output" ]]; then
TYPO_OUTPUTS+="$typos_output"\$
fi
done < ${{ env.CHANGED_FILE_LIST }}
echo "TYPO_OUTPUTS=$TYPO_OUTPUTS" >> $GITHUB_ENV
echo "TYPO_OUTPUTS: $TYPO_OUTPUTS"
- name: Run Ruby Action
uses: ./
with:
changed_file_list: "test"