diff --git a/.github/workflows/_local_ci_tests.yml b/.github/workflows/_local_ci_tests.yml index 1781eee6..393540ff 100644 --- a/.github/workflows/_local_ci_tests.yml +++ b/.github/workflows/_local_ci_tests.yml @@ -43,10 +43,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version}} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version}} + python-version: ${{ matrix.python-version }} allow-prereleases: true - name: Install Python dependencies @@ -81,10 +81,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version}} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version}} + python-version: ${{ matrix.python-version }} - name: Install Python dependencies run: | diff --git a/.github/workflows/cd_release.yml b/.github/workflows/cd_release.yml index 674570dc..2fe43dab 100644 --- a/.github/workflows/cd_release.yml +++ b/.github/workflows/cd_release.yml @@ -160,8 +160,8 @@ jobs: steps: - name: Validate inputs run: | - if [[ ! "${{ inputs.python_version_build}}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then - echo "Python version '${{ inputs.python_version_build}}' is not supported." + if [[ ! "${{ inputs.python_version_build }}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then + echo "Python version '${{ inputs.python_version_build }}' is not supported." echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13." exit 1 fi @@ -197,11 +197,13 @@ jobs: else echo 'CHANGELOG_EXCLUDE_TAGS_REGEX=' >> $GITHUB_ENV fi - if [ -n "${{ inputs.changelog_exclude_labels}}" ]; then + + if [ -n "${{ inputs.changelog_exclude_labels }}" ]; then echo 'CHANGELOG_EXCLUDE_LABELS=--exclude-labels "${{ inputs.changelog_exclude_labels }}"' >> $GITHUB_ENV else echo 'CHANGELOG_EXCLUDE_LABELS=' >> $GITHUB_ENV fi + PROJECT=$(echo $GITHUB_REPOSITORY | cut -d/ -f2- ) echo "CHANGELOG_PROJECT=--project ${PROJECT}" >> $GITHUB_ENV @@ -288,15 +290,22 @@ jobs: - name: Get tagged versions run: | if [ -n "${{ inputs.changelog_exclude_tags_regex }}" ]; then - echo "PREVIOUS_VERSION=$(git tag -l --sort -version:refname | grep -v -E "${{ inputs.changelog_exclude_tags_regex }}" | sed -n 2p)" >> $GITHUB_ENV + PREVIOUS_VERSION="$(git tag -l --sort -version:refname | grep -v -E "${{ inputs.changelog_exclude_tags_regex }}" | sed -n 2p)" + else + PREVIOUS_VERSION="$(git tag -l --sort -version:refname | sed -n 2p)" + fi + + if [ -n "${PREVIOUS_VERSION}" ]; then + SINCE_PREVIOUS_VERSION=--since-tag "${PREVIOUS_VERSION}" else - echo "PREVIOUS_VERSION=$(git tag -l --sort -version:refname | sed -n 2p)" >> $GITHUB_ENV + SINCE_PREVIOUS_VERSION= fi + echo "SINCE_PREVIOUS_VERSION=${SINCE_PREVIOUS_VERSION}" >> $GITHUB_ENV - name: Create release-specific changelog uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2 with: - args: --user "${{ github.repository_owner }}" ${{ env.CHANGELOG_PROJECT }} --token "${{ secrets.PAT || secrets.GITHUB_TOKEN }}" --release-branch "${{ inputs.release_branch }}" --since-tag "${{ env.PREVIOUS_VERSION }}" --output release_changelog.md --usernames-as-github-logins ${{ env.CHANGELOG_EXCLUDE_TAGS_REGEX }} ${{ env.CHANGELOG_EXCLUDE_LABELS }} + args: --user "${{ github.repository_owner }}" ${{ env.CHANGELOG_PROJECT }} --token "${{ secrets.PAT || secrets.GITHUB_TOKEN }}" --release-branch "${{ inputs.release_branch }}" ${{ env.SINCE_PREVIOUS_VERSION }} --output release_changelog.md --usernames-as-github-logins ${{ env.CHANGELOG_EXCLUDE_TAGS_REGEX }} ${{ env.CHANGELOG_EXCLUDE_LABELS }} - name: Append changelog to release body run: | @@ -334,8 +343,8 @@ jobs: - name: Check input run: | valid_frameworks=("mkdocs sphinx") - if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework}} " ]]; then - echo "The input '${{ inputs.docs_framework}}' is not supported." + if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework }} " ]]; then + echo "The input '${{ inputs.docs_framework }}' is not supported." echo "Valid inputs are: ${valid_frameworks[*]}" exit 1 fi diff --git a/.github/workflows/ci_cd_updated_default_branch.yml b/.github/workflows/ci_cd_updated_default_branch.yml index 47341116..d4711aa5 100644 --- a/.github/workflows/ci_cd_updated_default_branch.yml +++ b/.github/workflows/ci_cd_updated_default_branch.yml @@ -171,7 +171,7 @@ jobs: steps: - name: Release check run: | - COMMIT_MSG="$(gh api /repos/${{ github.repository}}/commits/${{ inputs.default_repo_branch }} --jq '.commit.message')" + COMMIT_MSG="$(gh api /repos/${{ github.repository }}/commits/${{ inputs.default_repo_branch }} --jq '.commit.message')" if [[ "${COMMIT_MSG}" =~ ^Release\ v.*$ ]] || [ "${COMMIT_MSG}" == "[bot] Update documentation" ]; then echo "In a release or just ran this job - do not run this job !" echo "RELEASE_RUN=true" >> $GITHUB_ENV @@ -186,14 +186,14 @@ jobs: if: env.RELEASE_RUN == 'false' run: | valid_frameworks=("mkdocs sphinx") - if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework}} " ]]; then - echo "The input '${{ inputs.docs_framework}}' is not supported." + if [[ ! " ${valid_frameworks[*]} " =~ " ${{ inputs.docs_framework }} " ]]; then + echo "The input '${{ inputs.docs_framework }}' is not supported." echo "Valid inputs are: ${valid_frameworks[*]}" exit 1 fi - if [[ ! "${{ inputs.python_version}}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then - echo "Python version '${{ inputs.python_version}}' is not supported." + if [[ ! "${{ inputs.python_version }}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then + echo "Python version '${{ inputs.python_version }}' is not supported." echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13." exit 1 fi @@ -372,7 +372,7 @@ jobs: else echo 'CHANGELOG_EXCLUDE_TAGS_REGEX=' >> $GITHUB_ENV fi - if [ -n "${{ inputs.changelog_exclude_labels}}" ]; then + if [ -n "${{ inputs.changelog_exclude_labels }}" ]; then echo 'CHANGELOG_EXCLUDE_LABELS=--exclude-labels "${{ inputs.changelog_exclude_labels }}"' >> $GITHUB_ENV else echo 'CHANGELOG_EXCLUDE_LABELS=' >> $GITHUB_ENV @@ -476,7 +476,7 @@ jobs: run: | git fetch origin - LATEST_PR_BODY="$(gh api /repos/${{ github.repository}}/pulls -X GET -f state=closed -f per_page=1 -f sort=updated -f direction=desc --jq '.[].body')" + LATEST_PR_BODY="$(gh api /repos/${{ github.repository }}/pulls -X GET -f state=closed -f per_page=1 -f sort=updated -f direction=desc --jq '.[].body')" cat ${PR_BODY_FILE} | head -8 > .tmp_file.txt if [ -z "$(printf '%s\n' "${LATEST_PR_BODY}" | head -8 | diff - .tmp_file.txt --strip-trailing-cr)" ]; then echo "The dependencies have just been updated! Reset to ${{ inputs.default_repo_branch }}." diff --git a/.github/workflows/ci_check_pyproject_dependencies.yml b/.github/workflows/ci_check_pyproject_dependencies.yml index 4b146b83..d5232b4f 100644 --- a/.github/workflows/ci_check_pyproject_dependencies.yml +++ b/.github/workflows/ci_check_pyproject_dependencies.yml @@ -79,8 +79,8 @@ jobs: steps: - name: Validate inputs run: | - if [[ ! "${{ inputs.python_version}}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then - echo "Python version '${{ inputs.python_version}}' is not supported." + if [[ ! "${{ inputs.python_version }}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then + echo "Python version '${{ inputs.python_version }}' is not supported." echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13." exit 1 fi @@ -233,7 +233,7 @@ jobs: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} committer: "${{ inputs.git_username }} <${{ inputs.git_email }}>" author: "${{ inputs.git_username }} <${{ inputs.git_email }}>" - branch: ci/update-pyproject${{ inputs.branch_name_extension && format('/{0}', inputs.branch_name_extension) || ''}} + branch: ci/update-pyproject${{ inputs.branch_name_extension && format('/{0}', inputs.branch_name_extension) || '' }} delete-branch: true title: "[Auto-generated] Check & update dependencies (`pyproject.toml`)" body: ${{ steps.pr_body.outputs.result }} diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 360c5efa..4f6e3711 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -350,8 +350,8 @@ jobs: - name: Validate inputs run: | - if [[ "${framework}" == "mkdocs" && ! "${{ inputs.python_version_docs}}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then - echo "Python version '${{ inputs.python_version_docs}}' is not supported." + if [[ "${framework}" == "mkdocs" && ! "${{ inputs.python_version_docs }}" =~ ^3\.([7-9]|1[0-3])(\..*)?$ ]]; then + echo "Python version '${{ inputs.python_version_docs }}' is not supported." echo "Supported versions are: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13." exit 1 fi