Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
- 'pyproject.toml'
- 'tests/**'

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand Down
45 changes: 27 additions & 18 deletions .github/workflows/scheduled-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- cron: '0 9 * * 1'
workflow_dispatch:

permissions:
contents: read

jobs:
scheduled-pre-commit:
runs-on: ubuntu-latest
Expand All @@ -28,18 +31,21 @@ jobs:
- name: Run pre-commit checks
id: precommit
run: |
uv run --extra dev pre-commit run --all-files > precommit_output.txt 2>&1
EXIT_CODE=$?
EXIT_CODE=0
uv run --extra dev pre-commit run --all-files > precommit_output.txt 2>&1 || EXIT_CODE=$?

OUTPUT=$(cat precommit_output.txt)
echo "output<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

if [ $EXIT_CODE -eq 0 ]; then
echo "status=success" >> $GITHUB_OUTPUT
echo "$OUTPUT"
{
echo "output<<EOF"
echo "$OUTPUT"
echo "EOF"
} >> "$GITHUB_OUTPUT"

if [ "$EXIT_CODE" -eq 0 ]; then
echo "status=success" >> "$GITHUB_OUTPUT"
else
echo "status=failed" >> $GITHUB_OUTPUT
echo "status=failed" >> "$GITHUB_OUTPUT"
exit 1
fi

Expand All @@ -57,18 +63,21 @@ jobs:
- name: Run markdown checks
id: markdown
run: |
pymarkdownlnt scan docs > markdown_output.txt 2>&1
EXIT_CODE=$?
EXIT_CODE=0
pymarkdownlnt scan docs > markdown_output.txt 2>&1 || EXIT_CODE=$?

OUTPUT=$(cat markdown_output.txt)
echo "output<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

if [ $EXIT_CODE -eq 0 ]; then
echo "status=success" >> $GITHUB_OUTPUT
echo "$OUTPUT"
{
echo "output<<EOF"
echo "$OUTPUT"
echo "EOF"
} >> "$GITHUB_OUTPUT"

if [ "$EXIT_CODE" -eq 0 ]; then
echo "status=success" >> "$GITHUB_OUTPUT"
else
echo "status=failed" >> $GITHUB_OUTPUT
echo "status=failed" >> "$GITHUB_OUTPUT"
exit 1
fi

Loading