From d6115b90b53bf456f27515eec7f742068a0fc540fb168f39f29391f37e06faae Mon Sep 17 00:00:00 2001 From: "Marc S. Weidner" Date: Thu, 5 Jun 2025 22:58:57 +0200 Subject: [PATCH] V8.03.400.2025.06.05 Signed-off-by: Marc S. Weidner --- .gitea/workflows/linter_char_scripts.yaml | 115 +++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/linter_char_scripts.yaml b/.gitea/workflows/linter_char_scripts.yaml index b301442..0bf595d 100644 --- a/.gitea/workflows/linter_char_scripts.yaml +++ b/.gitea/workflows/linter_char_scripts.yaml @@ -199,8 +199,121 @@ jobs: if [[ -n "${findings}" ]]; then echo -e "⚠️ Linting issues detected:\n" echo -e "${findings}" - exit 1 + timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + PRIVATE_FILE="LINTER_RESULTS.txt" + touch "${PRIVATE_FILE}" + cat << EOF >| "${PRIVATE_FILE}" + # SPDX-Version: 3.0 + # SPDX-CreationInfo: 2025-06-05; WEIDNER, Marc S.; + # SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git + # SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency + # SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; + # SPDX-FileType: SOURCE + # SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0 + # SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework. + # SPDX-PackageName: CISS.debian.live.builder + # SPDX-Security-Contact: security@coresecret.eu + + This file was automatically generated by the DEPLOY BOT on: "${timestamp}". + + ⚠️ The last linter check was NOT successful. ⚠️ + + # vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text + EOF else echo "✅ No issues found in shell scripts." + timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + PRIVATE_FILE="LINTER_RESULTS.txt" + touch "${PRIVATE_FILE}" + cat << EOF >| "${PRIVATE_FILE}" + # SPDX-Version: 3.0 + # SPDX-CreationInfo: 2025-06-05; WEIDNER, Marc S.; + # SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git + # SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency + # SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; + # SPDX-FileType: SOURCE + # SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0 + # SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework. + # SPDX-PackageName: CISS.debian.live.builder + # SPDX-Security-Contact: security@coresecret.eu + + This file was automatically generated by the DEPLOY BOT on: "${timestamp}". + + ✅ The last linter check was successful. ✅ + + # vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=text + EOF fi + + - name: 🔄 Sync with remote before commit using merge strategy. + shell: bash + env: + GIT_SSH_COMMAND: "ssh -p 42842" + run: | + set -euo pipefail + export GNUPGHOME="$(pwd)/.gnupg" + + echo "🔄 Fetching origin/master ..." + git fetch origin master + + echo "🔁 Merging origin/master into current branch ..." + git merge --no-edit origin/master || echo "✔️ Already up to date or fast-forward." + + echo "📋 Post-merge status :" + git status + git log --oneline -n 5 + + - name: 📦 Stage generated files. + shell: bash + env: + GIT_SSH_COMMAND: "ssh -p 42842" + run: | + set -euo pipefail + PRIVATE_FILE="LINTER_RESULTS.txt" + git add "${PRIVATE_FILE}" || echo "✔️ Nothing to add." + + - name: 🔑 Commit and sign changes with CI metadata. + shell: bash + env: + GIT_SSH_COMMAND: "ssh -p 42842" + run: | + set -euo pipefail + export GNUPGHOME="$(pwd)/.gnupg" + + if git diff --cached --quiet; then + echo "✔️ No staged changes to commit." + else + echo "📝 Committing changes with GPG signature ..." + + ### CI Metadata + TIMESTAMP_UTC="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + HOSTNAME="$(hostname -f || hostname)" + GIT_SHA="$(git rev-parse --short HEAD)" + GIT_REF="$(git symbolic-ref --short HEAD || echo detached)" + WORKFLOW_ID="${GITHUB_WORKFLOW:-render-md-to-html.yaml}" + CI_HEADER="X-CI-Metadata: ${GIT_REF}@${GIT_SHA} at ${TIMESTAMP_UTC} on ${HOSTNAME}" + + COMMIT_MSG="DEPLOY BOT: 🛡️ Shell Script Linting [skip ci] + + ${CI_HEADER} + + Generated at: ${TIMESTAMP_UTC} + Runner Host : ${HOSTNAME} + Workflow ID : ${WORKFLOW_ID} + Git Commit : ${GIT_SHA} HEAD → ${GIT_REF} + " + + echo "🔏 Commit message :" + echo "${COMMIT_MSG}" + git commit -S -m "${COMMIT_MSG}" + fi + + - name: 🔁 Push back to repository. + shell: bash + env: + GIT_SSH_COMMAND: "ssh -p 42842" + run: | + set -euo pipefail + echo "📤 Pushing changes to ${GITHUB_REF_NAME} ..." + git push origin HEAD:${GITHUB_REF_NAME} # vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=yaml