From f181b947052f788ac5e10c8ef37bc7ffcde16f0f Mon Sep 17 00:00:00 2001 From: Esa Jokinen Date: Tue, 26 Dec 2023 21:54:05 +0200 Subject: [PATCH 1/2] Separate workflows for shell & python scripts --- .github/workflows/python.yml | 18 ++++++++++++++++++ .github/workflows/{lint.yml => shell.yml} | 13 ++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/python.yml rename .github/workflows/{lint.yml => shell.yml} (58%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..ebedd59 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,18 @@ +name: Black (Python) +on: + push: + pull_request: + branches: + - main + +jobs: + black: + name: Black + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check Black formatting for Python scripts + uses: psf/black@stable + with: + options: --check --verbose + src: . diff --git a/.github/workflows/lint.yml b/.github/workflows/shell.yml similarity index 58% rename from .github/workflows/lint.yml rename to .github/workflows/shell.yml index 754ddd5..19953e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/shell.yml @@ -1,4 +1,4 @@ -name: Lint +name: ShellCheck on: push: pull_request: @@ -6,20 +6,15 @@ on: - main jobs: - lint: - name: Lint + shellcheck: + name: ShellCheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Run ShellCheck + - name: Run ShellCheck for shell scripts uses: ludeeus/action-shellcheck@master with: severity: style scandir: . format: gcc version: stable - - name: Black formatting (Python) - uses: psf/black@stable - with: - options: --check --verbose - src: . From 33a0f2bb4fcdda02342d0066a88b4c226093844d Mon Sep 17 00:00:00 2001 From: Esa Jokinen <58781154+oh2fih@users.noreply.github.com> Date: Tue, 26 Dec 2023 21:57:06 +0200 Subject: [PATCH 2/2] README.md: add workflow badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 90eba7c..78b00e1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ Miscellaneous scripts for different purposes. Mostly unrelated to each other. +![ShellCheck](https://github.com/oh2fih/Misc-Scripts/workflows/ShellCheck/badge.svg) +![Black (Python)](https://github.com/oh2fih/Misc-Scripts/workflows/Black%20(Python)/badge.svg) + | Category | Script & Language | Purpose & Usage | |:---|:---|:---| | Email | [`mail-prepender.sh`](bin/mail-prepender.sh)
Shell (bash) | Prepends (to stdin/stdout) email header strings given in as flags `i`, `I`, `a`, or `A`; after possible mbox `From` & `Return-Path` header lines. Intended as a limited `formail` replacement that ignores the nyanses of the flags and simply prepends the valid (RFC 5322, 2.2) non-empty headers keeping the other headers as is. Flags `x` & `X` are implemented. Any other flags are ignored. |