From 8cc022384206e8b480b9b9be256f7f5a61de2d9f Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 18:48:31 -0500 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20feature:=20Create=20Changelog?= =?UTF-8?q?=20Changes=20Check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/changelog-changed.yml | 77 +++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/changelog-changed.yml diff --git a/.github/workflows/changelog-changed.yml b/.github/workflows/changelog-changed.yml new file mode 100644 index 0000000..dc1c135 --- /dev/null +++ b/.github/workflows/changelog-changed.yml @@ -0,0 +1,77 @@ +# This workflow ensures that a change was made to the changelog +--- +name: Changelog Changed +run-name: >- + ${{ + format( + '{0} - Changelog Changed{1}', + github.event_name == 'pull_request' + && format('PR#{0}{1}',github.event.number, github.event.pull_request.draft && ' [DRAFT]' || '') + || format('Push [{0}]', github.ref_name), + github.event_name == 'pull_request' + && format(' - [{0}-to-{1}]', github.event.pull_request.head.ref, github.event.pull_request.base.ref) + || '' + ) + }} + +on: + pull_request: + branches: + - main + - develop + types: + - opened + - reopened + - synchronize + - ready_for_review + # Trigger if target branch was changed to a trunk + pull_request_target: + types: + - edited + branches: + - main + - develop + +concurrency: + group: Changelog-${{ github.event.pull_request.head.ref }}-to-${{ github.event.pull_request.base.ref }} + cancel-in-progress: true + +jobs: + checkForChangesToChangelog: + name: Changelog Changed + permissions: + contents: read # Read access to code and content in the repository + pull-requests: read # Read access to pull request metadata for the event + checks: write # Write access to report check results + runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} + + steps: + # Checkout pull request branch + - name: ${{ format('Checkout [{0}]', github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name) }} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + token: ${{ secrets.TJC_TOKEN || secrets.GITHUB_TOKEN }} + + # Check for Changes in Changelog + - name: Check for Changes to Changelog + id: getChanges + uses: tj-actions/changed-files@v45.0.3 + with: + files: CHANGELOG.md + + # Report Success + - name: Success - Changelog Changed + if: steps.getChanges.outputs.any_modified == 'true' + uses: ./.github/actions/tools/annotation/notice + with: + message: "[Success] Changelog Changed" + + # Report Failure + - name: Failure - Changelog Not Changed + if: steps.getChanges.outputs.any_modified != 'true' + uses: ./.github/actions/tools/exit-code + with: + code: 5 + message: "Changelog Not Changed" From a057d7e0fbeea49d81fd1772e40f7f30af374b63 Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 18:53:51 -0500 Subject: [PATCH 2/6] Update Exit Code Action (for multiple OS's) --- .github/actions/tools/exit-code/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/tools/exit-code/action.yml b/.github/actions/tools/exit-code/action.yml index 0f9ff16..78282dd 100644 --- a/.github/actions/tools/exit-code/action.yml +++ b/.github/actions/tools/exit-code/action.yml @@ -44,4 +44,9 @@ runs: message: ${{ steps.createMessage.outputs.result }} - shell: cmd + if: ${{ runner.os == 'Windows' }} + run: exit ${{ inputs.code }} + + - shell: bash + if: ${{ runner.os != 'Windows' }} run: exit ${{ inputs.code }} From 7d3bfb47ecf679da73d3b44a04312a30fe404470 Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 19:00:59 -0500 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 049601e..4466984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Changelog changed check workflow for pr's + ## [0.6.2] - 2024-11-10 ### Changed From add370a71e21ccd2edf742f031d810e19e801e63 Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 19:23:19 -0500 Subject: [PATCH 4/6] Update .jscpd.json to ignore .github --- .jscpd.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jscpd.json b/.jscpd.json index 3806512..f916643 100644 --- a/.jscpd.json +++ b/.jscpd.json @@ -1,4 +1,4 @@ { "threshold": 0.1, - "ignore": ["*.Tests/**"] + "ignore": ["*.Tests/**",".github/**"] } From fa40bad22ea5d2e4bcde0db819b855220ee52367 Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 19:44:08 -0500 Subject: [PATCH 5/6] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cb5ff9f..e3d5387 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,6 @@ [![License](https://img.shields.io/github/license/TJC-Tools/TJC.StringExtensions.svg)](LICENSE) [![codecov](https://codecov.io/gh/TJC-Tools/TJC.StringExtensions/graph/badge.svg?token=RJ4DWNQ7S5)](https://codecov.io/gh/TJC-Tools/TJC.StringExtensions) + +## Documentation +- [Changelog](CHANGELOG.md) From 8360b6129b590091faf0c41febb39b1d5ce9998d Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Thu, 14 Nov 2024 19:46:39 -0500 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20[MegaLinter]=20Appl?= =?UTF-8?q?y=20[1]=20automatic=20fixes=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: TylerCarrol <25536704+TylerCarrol@users.noreply.github.com> --- .jscpd.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jscpd.json b/.jscpd.json index f916643..4db0004 100644 --- a/.jscpd.json +++ b/.jscpd.json @@ -1,4 +1,4 @@ { "threshold": 0.1, - "ignore": ["*.Tests/**",".github/**"] + "ignore": ["*.Tests/**", ".github/**"] }