From 04639e76ebdf05eddfea4fe36575a3e750cbe847 Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Sat, 11 Mar 2023 10:52:19 +0530 Subject: [PATCH 1/6] Create maven-publish.yml --- .github/workflows/maven-publish.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 00000000..dab69fef --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,34 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} From 936463493765acf324def0782085da6211ad971f Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:47:26 +0530 Subject: [PATCH 2/6] Create commit.yml --- .github/workflows/commit.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/commit.yml diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml new file mode 100644 index 00000000..c3eeb88c --- /dev/null +++ b/.github/workflows/commit.yml @@ -0,0 +1,29 @@ +on: + push: + branches: + - main + +jobs: + block-sensitive-data-commits: + runs-on: ubuntu-latest + steps: + - name: Check for Sensitive Data + uses: reviewdog/action-git-secrets@v2.x + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # Customize scan options as needed + scan_key: aws_access_key_id|aws_secret_access_key|password|private_key + + - name: Block Commit if Sensitive Data Found + uses: sdras/lock-threads-on-label-action@v4 + if: always() + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + label-name: 'Sensitive Data Found' + custom-message: 'Commit blocked: sensitive data detected in changes' + + - name: Auto-commit Changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'Block commit: sensitive data detected in changes' + commit_options: '--no-verify' From 04dc4ec98e3346ce91a062bdfe710c796ba9dde2 Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:58:14 +0530 Subject: [PATCH 3/6] Create reviewdog.yml --- .github/workflows/reviewdog.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 00000000..a76d305c --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,11 @@ +name: reviewdog +on: [pull_request] +jobs: + detect-secrets: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: detect-secrets + uses: reviewdog/action-detect-secrets@master + with: + reporter: github-pr-review # Change reporter. From db514505fb67cc8a347d774c5b29428539f1764a Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:00:27 +0530 Subject: [PATCH 4/6] Update commit.yml --- .github/workflows/commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index c3eeb88c..751cb82d 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -7,8 +7,8 @@ jobs: block-sensitive-data-commits: runs-on: ubuntu-latest steps: - - name: Check for Sensitive Data - uses: reviewdog/action-git-secrets@v2.x + - name: Run detect-secrets with reviewdog + uses: reviewdog/action-detect-secrets@v0.11.5 with: github_token: ${{ secrets.GITHUB_TOKEN }} # Customize scan options as needed From 07a23b0af3634fdb6963a1791463a68f571612f4 Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:02:51 +0530 Subject: [PATCH 5/6] Update reviewdog.yml --- .github/workflows/reviewdog.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index a76d305c..a254dd0a 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: detect-secrets - uses: reviewdog/action-detect-secrets@master + - name: Run detect-secrets with reviewdog + uses: reviewdog/action-detect-secrets@v0.11.5 with: reporter: github-pr-review # Change reporter. From d37a803d8b39b2c46586815e39439117b8bdc5f6 Mon Sep 17 00:00:00 2001 From: Ishrath Fatima <68281840+Ishrath786@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:07:07 +0530 Subject: [PATCH 6/6] Delete commit.yml --- .github/workflows/commit.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/commit.yml diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml deleted file mode 100644 index 751cb82d..00000000 --- a/.github/workflows/commit.yml +++ /dev/null @@ -1,29 +0,0 @@ -on: - push: - branches: - - main - -jobs: - block-sensitive-data-commits: - runs-on: ubuntu-latest - steps: - - name: Run detect-secrets with reviewdog - uses: reviewdog/action-detect-secrets@v0.11.5 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Customize scan options as needed - scan_key: aws_access_key_id|aws_secret_access_key|password|private_key - - - name: Block Commit if Sensitive Data Found - uses: sdras/lock-threads-on-label-action@v4 - if: always() - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - label-name: 'Sensitive Data Found' - custom-message: 'Commit blocked: sensitive data detected in changes' - - - name: Auto-commit Changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: 'Block commit: sensitive data detected in changes' - commit_options: '--no-verify'