From 9870aeb375528ace0f2e771a760ce268277f13b0 Mon Sep 17 00:00:00 2001 From: Emanuela Epure <67077116+emanuelaepure10@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:30:56 +0100 Subject: [PATCH 1/2] fix: add folder for unwanted files bla bla ING-8776 --- .../check-commit-message.yml_no_wanted | 63 +++++++++++++++ .../commit-quality-checker.yml_no_wanted} | 0 .../commit_message.yml_no_wanted | 79 +++++++++++++++++++ .../commitlint.yml_no_wanted | 68 ++++++++++++++++ 4 files changed, 210 insertions(+) create mode 100644 .github/workflows/unwanted_workflows/check-commit-message.yml_no_wanted rename .github/workflows/{commit-quality-checker.yml => unwanted_workflows/commit-quality-checker.yml_no_wanted} (100%) create mode 100644 .github/workflows/unwanted_workflows/commit_message.yml_no_wanted create mode 100644 .github/workflows/unwanted_workflows/commitlint.yml_no_wanted diff --git a/.github/workflows/unwanted_workflows/check-commit-message.yml_no_wanted b/.github/workflows/unwanted_workflows/check-commit-message.yml_no_wanted new file mode 100644 index 0000000..a3a82bc --- /dev/null +++ b/.github/workflows/unwanted_workflows/check-commit-message.yml_no_wanted @@ -0,0 +1,63 @@ + # https://github.com/marketplace/actions/check-commit-message + +# TEST 1 +# feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# success + +# TEST 2 +# fixup! feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# success + +# TEST 3 +# docs: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# success + +# TEST 4 +# feat!: send an email to the customer when a product is shipped +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3231 +# fails + +# TEST 5 +# feat(api)!: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# +# Remove timeouts which were used to mitigate the racing issue but are +# obsolete now. +# +# Reviewed-by: Z +# Refs: #123 +# fails + +# TEST 6 +# chore: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# fails + +name: Check Commit Message + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v2 + + - name: Check commit ๐Ÿงช + uses: adityaa30/check-commit@master \ No newline at end of file diff --git a/.github/workflows/commit-quality-checker.yml b/.github/workflows/unwanted_workflows/commit-quality-checker.yml_no_wanted similarity index 100% rename from .github/workflows/commit-quality-checker.yml rename to .github/workflows/unwanted_workflows/commit-quality-checker.yml_no_wanted diff --git a/.github/workflows/unwanted_workflows/commit_message.yml_no_wanted b/.github/workflows/unwanted_workflows/commit_message.yml_no_wanted new file mode 100644 index 0000000..2b17aa9 --- /dev/null +++ b/.github/workflows/unwanted_workflows/commit_message.yml_no_wanted @@ -0,0 +1,79 @@ +# custom commit checker + +# TEST 1 +# feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 2 +# fixup! feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 3 +# docs: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 4 +# feat!: send an email to the customer when a product is shipped +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3231 +# fails + +# TEST 5 +# feat(api)!: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# +# Remove timeouts which were used to mitigate the racing issue but are +# obsolete now. +# +# Reviewed-by: Z +# Refs: #123 +# fails + +# TEST 6 +# chore: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# success - but I wanted it to fail + +name: Check Commit Message CUSTOM + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + check_commit_message: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check commit message + run: | + COMMIT_MSG=$(git log --format=%B -n 1 ${{ github.sha }}) + PATTERN_MSG='^(fixup! )?(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$' + if [[ ! $COMMIT_MSG =~ $PATTERN_MSG ]]; then + echo "Invalid commit message format. Must match pattern: /^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$/" + exit 1 + fi + + - name: Check commit description + run: | + COMMIT_DESC=$(git log --format=%b -n 1 ${{ github.sha }}) + PATTERN_DESC='^.{1,200}$' + if [[ ! $COMMIT_DESC =~ $PATTERN_DESC ]]; then + echo "Invalid commit description format. Must be up to 200 characters long." + exit 1 + fi diff --git a/.github/workflows/unwanted_workflows/commitlint.yml_no_wanted b/.github/workflows/unwanted_workflows/commitlint.yml_no_wanted new file mode 100644 index 0000000..61d4cc4 --- /dev/null +++ b/.github/workflows/unwanted_workflows/commitlint.yml_no_wanted @@ -0,0 +1,68 @@ + # + +# TEST 1 +# feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 2 +# fixup! feat: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 3 +# docs: update action conventional commits +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3232 +# fails + +# TEST 4 +# feat!: send an email to the customer when a product is shipped +# BREAKING CHANGE: `extends` key in config file is now used for extending other config files +# ING-3231 +# fails + +# TEST 5 +# feat(api)!: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# +# Remove timeouts which were used to mitigate the racing issue but are +# obsolete now. +# +# Reviewed-by: Z +# Refs: #123 +# fails + + +# TEST 6 +# chore: send an email to the customer when a product is shipped +# Introduce a request id and a reference to latest request. Dismiss +# incoming responses other than from latest request. +# fails + +name: Commitlint + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + commitlint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: npm install @commitlint-github-action@v5 + + - name: Run commitlint + run: npx commitlint --from=$GITHUB_SHA~1 --to=$GITHUB_SHA From 9be59fa5373833c6073ef6f8e0a317fbfa8a98bf Mon Sep 17 00:00:00 2001 From: Emanuela Epure <67077116+emanuelaepure10@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:08:30 +0100 Subject: [PATCH 2/2] feat: add more more description ING-5354 --- .../workflows/block-fixup-commit-merge.yml | 2 +- .github/workflows/loopwerk_tag-changelog.yml | 53 +++++++++++++++++++ .../workflows/requarks-changelog-action.yml | 41 ++++++++++++++ CHANGELOG.md | 0 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/loopwerk_tag-changelog.yml create mode 100644 .github/workflows/requarks-changelog-action.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/block-fixup-commit-merge.yml b/.github/workflows/block-fixup-commit-merge.yml index 68e686e..73821f8 100644 --- a/.github/workflows/block-fixup-commit-merge.yml +++ b/.github/workflows/block-fixup-commit-merge.yml @@ -1,4 +1,4 @@ - # block-fixup-commit-merge + # block-fixup-commit-merge https://github.com/marketplace/actions/block-fixup-commit-merge name: Git Checks diff --git a/.github/workflows/loopwerk_tag-changelog.yml b/.github/workflows/loopwerk_tag-changelog.yml new file mode 100644 index 0000000..e6f67fa --- /dev/null +++ b/.github/workflows/loopwerk_tag-changelog.yml @@ -0,0 +1,53 @@ + # https://github.com/requarks/changelog-action + + +name: Create Release + +on: + push: + tags: + - 'vs.*' + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Create changelog text + id: changelog + uses: loopwerk/tag-changelog@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude_types: other,perf + + - name: Create release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ steps.changelog.outputs.changes }} + + - name: Read CHANGELOG.md + id: package + uses: juliangruber/read-file-action@v1 + with: + path: ./CHANGELOG.md + + - name: Write to CHANGELOG.md + uses: DamianReeves/write-file-action@master + with: + path: ./CHANGELOG.md + contents: ${{ steps.changelog.outputs.changelog }}${{ steps.package.outputs.content }} + write-mode: overwrite + + - name: Commit and push CHANGELOG.md + uses: EndBug/add-and-commit@v7 + with: + add: CHANGELOG.md + message: "chore: Update CHANGELOG.md" + branch: main \ No newline at end of file diff --git a/.github/workflows/requarks-changelog-action.yml b/.github/workflows/requarks-changelog-action.yml new file mode 100644 index 0000000..6ba303d --- /dev/null +++ b/.github/workflows/requarks-changelog-action.yml @@ -0,0 +1,41 @@ + # https://github.com/requarks/changelog-action + + +name: Requarks changelog-action + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + + - name: Create Release + uses: ncipollo/release-action@v1.12.0 + with: + allowUpdates: true + draft: false + makeLatest: true + name: ${{ github.ref_name }} + body: ${{ steps.changelog.outputs.changes }} + token: ${{ github.token }} + + - name: Commit CHANGELOG.md + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' + file_pattern: CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29