Skip to content

Merge branch 'master' of https://github.com/Deltares/ra2ce #124

Merge branch 'master' of https://github.com/Deltares/ra2ce

Merge branch 'master' of https://github.com/Deltares/ra2ce #124

name: ci-normalize-code
on:
push:
branches:
- master
env:
AUTOFORMAT_COMMIT_MESSAGE: "chore: autoformat isort & black"
jobs:
normalize-code:
if: ${{ (!startsWith(github.event.head_commit.message, 'bump:')) && (github.event.head_commit.message != env.AUTOFORMAT_COMMIT_MESSAGE)}}

Check failure on line 13 in .github/workflows/normalize_code.yml

View workflow run for this annotation

GitHub Actions / ci-normalize-code

Invalid workflow file

The workflow is not valid. .github/workflows/normalize_code.yml (Line: 13, Col: 9): Unrecognized named-value: 'env'. Located at position 98 within expression: (!startsWith(github.event.head_commit.message, 'bump:')) && (github.event.head_commit.message != env.AUTOFORMAT_COMMIT_MESSAGE)
name: "Normalize code with internal standards"
permissions: write-all
strategy:
fail-fast: true
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v4
with:
token: ${{ secrets.BYPASS_PROTECTED_BRANCHES_PAT }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0
- name: Cache Poetry virtualenv
uses: actions/cache@v4
id: cache
with:
path: ~/.virtualenvs
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ matrix.os }}-${{ matrix.python-version }}-
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install --only dev
if: steps.cache.outputs.cache-hit != 'true'
- name: Autoformat code if the check fails
run: |
poetry run isort .
poetry run black .
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: $AUTOFORMAT_COMMIT_MESSAGE
push_options: --force