pre-commit-github-workflow-push #556
This file contains hidden or 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
| --- | |
| name: pre-commit-github-workflow-push | |
| on: | |
| push: | |
| schedule: | |
| - cron: "0 6 * * 1" | |
| workflow_dispatch: | |
| # secrets: | |
| # SLACK_WEBHOOK: | |
| # description: "Optional, enables Slack notifications." | |
| # required: false | |
| jobs: | |
| configuration: | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-read_json_file.yml@main | |
| with: | |
| JSON_FILE_PATH: ".github/config/workflows/workflow-push.json" | |
| start: | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@main | |
| with: | |
| NOTIFICATION_EMOJI: ":vertical_traffic_light:" | |
| NOTIFICATION_MESSAGE: "Workflow has started!" | |
| security: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-10-generic-security_scan_credentials.yml@main | |
| with: | |
| EXTRA_BINARY_ARGS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_trufflehog_extra_scan_args }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| spelling_vocabularies: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "spelling-vale-vocab" | |
| PRECOMMIT_HOOK_NAME: "Spelling vocabularies" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| git_conflict_markers: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "git-conflict-markers" | |
| PRECOMMIT_HOOK_NAME: "Git conflict markers" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| markdown_links: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-30-generic-markdown_links.yml@main | |
| with: | |
| CONFIG_FILE: ".github/config/actions/gaurav-nelson-github-action-markdown-link-check.json" | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| pre-commit_hooks: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-50-poetry-test_basic_precommit_hooks.yml@main | |
| with: | |
| CHECK_TOML: true | |
| CHECK_WORKFLOW: true | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| commit_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-rev_range_command.yml@main | |
| with: | |
| COMMAND: | | |
| poetry run cz check --rev-range "${PUSHED_COMMIT_REV_RANGE}" | |
| COMMAND_NAME: "Commit Message Lint" | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| REV_RANGE: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_commitizen_rev_range }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| commit_spell_check: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-rev_range_command.yml@main | |
| with: | |
| COMMAND: | | |
| CICD_COMMIT_MESSAGES_FILE="$(mktemp XXXXXXXX.git_history_file)" | |
| git log --pretty=format:%s "${PUSHED_COMMIT_REV_RANGE}" > "${CICD_COMMIT_MESSAGES_FILE}" | |
| poetry run pre-commit run --hook-stage manual spelling-vale-sync | |
| poetry run pre-commit run --hook-stage commit-msg spelling-commit-message --commit-msg-filename "${CICD_COMMIT_MESSAGES_FILE}" | |
| COMMAND_NAME: "Commit Message Spelling" | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| REV_RANGE: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_commit_spelling_rev_range }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| json_schema_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "check-jsonschema" | |
| PRECOMMIT_HOOK_NAME: "Workflow Config JSON Schema Linting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| markdown_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "lint-markdown" | |
| PRECOMMIT_HOOK_NAME: "Markdown Linting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| markdown_spelling: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRE_HOOK_COMMAND: poetry run pre-commit run --hook-stage manual spelling-vale-sync | |
| PRECOMMIT_HOOK_ID: "spelling-markdown" | |
| PRECOMMIT_HOOK_NAME: "Markdown Spelling" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| pre-commit_config_sorting: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "pre-commit-sort-config" | |
| PRECOMMIT_HOOK_NAME: "Pre-Commit Config" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| pre-commit_hooks_sorting: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "pre-commit-sort-hooks" | |
| PRECOMMIT_HOOK_NAME: "Pre-Commit Hooks" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| python_formatting: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "black" | |
| PRECOMMIT_HOOK_NAME: "Python Formatting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| python_import_sorting: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "isort" | |
| PRECOMMIT_HOOK_NAME: "Python Import Sorting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| python_test: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-40-poetry-run_cached_commands.yml@main | |
| with: | |
| COMMANDS: | | |
| make test-python | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| shell_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| hook: | |
| - id: "format-shell" | |
| name: "Shell Formatting" | |
| - id: "lint-shell" | |
| name: "Shell Linting" | |
| max-parallel: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: ${{ matrix.hook.id }} | |
| PRECOMMIT_HOOK_NAME: ${{ matrix.hook.name }} | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| toml_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "format-toml" | |
| PRECOMMIT_HOOK_NAME: "TOML Formatting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| workflow_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| hook: | |
| - id: "lint-github-workflow" | |
| name: "Workflow Linting" | |
| - id: "lint-github-workflow-header" | |
| name: "Workflow Header Linting" | |
| max-parallel: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: ${{ matrix.hook.id }} | |
| PRECOMMIT_HOOK_NAME: ${{ matrix.hook.name }} | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| yaml_lint: | |
| needs: | |
| - configuration | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@main | |
| with: | |
| CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} | |
| INSTALL_PROJECT: true | |
| PRECOMMIT_HOOK_ID: "yamllint" | |
| PRECOMMIT_HOOK_NAME: "YAML Linting" | |
| PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} | |
| VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_verbose_notifications }} | |
| create_release: | |
| permissions: | |
| contents: write | |
| needs: | |
| - commit_lint | |
| - commit_spell_check | |
| - configuration | |
| - git_conflict_markers | |
| - json_schema_lint | |
| - markdown_links | |
| - markdown_lint | |
| - markdown_spelling | |
| - pre-commit_hooks | |
| - pre-commit_config_sorting | |
| - pre-commit_hooks_sorting | |
| - python_formatting | |
| - python_import_sorting | |
| - python_test | |
| - security | |
| - start | |
| - shell_lint | |
| - spelling_vocabularies | |
| - toml_lint | |
| - workflow_lint | |
| - yaml_lint | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-99-poetry-create_release.yml@main | |
| with: | |
| JSON_APPENDED_CONTENT: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_extra_release_content) }} | |
| success: | |
| needs: | |
| - create_release | |
| secrets: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: cicd-tools-org/cicd-tools/.github/workflows/job-00-generic-notification.yml@main | |
| with: | |
| NOTIFICATION_EMOJI: ":checkered_flag:" | |
| NOTIFICATION_MESSAGE: "Workflow has completed successfully!" |