Bump ruff from 0.1.14 to 0.1.15 #141
Workflow file for this run
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
--- | |
# Run all dev tools and update README.md | |
name: Run dev tools and update README.md | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
pull_request: | |
jobs: | |
update_readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install rssfixer and dev dependencies | |
run: | | |
python -m pip install poetry | |
poetry install --with dev,github --no-interaction | |
# yamllint disable rule:line-length | |
- name: Run bandit | |
run: poetry run bandit -l -f json -o resources/bandit.json -r src/rssfixer | |
# yamllint enable | |
# yamllint disable rule:line-length | |
- name: Commit updated bandit.json | |
id: commit_bandit | |
run: | | |
git add resources/bandit.json | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
if git diff --quiet && git diff --staged --quiet; then | |
echo "No changes in bandit.json, skipping commit." | |
echo "commit_status=skipped" >> "$GITHUB_ENV" | |
else | |
git commit -m "Update bandit.json" | |
echo "commit_status=committed" >> "$GITHUB_ENV" | |
fi | |
# yamllint enable | |
- name: Run update-readme.py | |
run: poetry run markdown-code-runner --verbose README.md | |
# yamllint disable rule:line-length | |
- name: Commit updated README.md | |
id: commit_readme | |
run: | | |
git add README.md | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
if git diff --quiet && git diff --staged --quiet; then | |
echo "No changes in README.md, skipping commit." | |
else | |
git commit -m "Update README.md" | |
echo "commit_status=committed" >> "$GITHUB_ENV" | |
fi | |
# yamllint enable | |
- name: Run coverage and create badge | |
run: | | |
poetry run coverage run -m pytest | |
poetry run coverage report -m > resources/coverage.txt | |
poetry run coverage-badge -f -q -o resources/coverage.svg | |
# yamllint disable rule:line-length | |
- name: Commit updated resources/coverage.txt resources/coverage.svg | |
id: commit | |
run: | | |
git add resources/coverage.txt resources/coverage.svg | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
if git diff --quiet && git diff --staged --quiet; then | |
echo "No changes in resources/coverage.txt or resources/coverage.svg, skipping commit." | |
else | |
git commit -m "Update resources/coverage.txt resources/coverage.svg" | |
echo "commit_status=committed" >> "$GITHUB_ENV" | |
fi | |
# yamllint enable | |
# yamllint disable rule:line-length | |
- name: Push changes | |
if: env.commit_status == 'committed' && github.actor != 'dependabot[bot]' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.head_ref }} | |
# yamllint enable |