Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSD-3932] Updated push-trigger.yml #1483

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
fe2ba0e
[DSD-3932] Updated push-trigger.yml
Rakshithb1 Jan 8, 2024
678ffcb
Update push-trigger.yml
Rakshithb12 Jan 12, 2024
2c08faa
Merge pull request #1 from Rakshithb12/develop
Rakshithb1 Jan 12, 2024
71a478b
Create add-checks.yml
Rakshithb1 Jan 12, 2024
4c06e26
Update add-checks.yml
Rakshithb1 Jan 12, 2024
5e89f4e
Update add-checks.yml
Rakshithb1 Jan 12, 2024
fe94c07
Update add-checks.yml
Rakshithb1 Jan 12, 2024
d2004dd
Update add-checks.yml
Rakshithb1 Jan 12, 2024
04f6ab8
Update add-checks.yml
Rakshithb1 Jan 12, 2024
f282451
Update add-checks.yml
Rakshithb1 Jan 12, 2024
9abc231
Update add-checks.yml
Rakshithb1 Jan 12, 2024
272f967
Update add-checks.yml
Rakshithb1 Jan 12, 2024
e69d5ed
Update add-checks.yml
Rakshithb1 Jan 12, 2024
2c6c9cb
Update add-checks.yml
Rakshithb1 Jan 12, 2024
94bdf14
Update add-checks.yml
Rakshithb1 Jan 12, 2024
1bec392
Update add-checks.yml
Rakshithb1 Jan 12, 2024
70a8540
Update add-checks.yml
Rakshithb1 Jan 12, 2024
04f6f1d
Update add-checks.yml
Rakshithb1 Jan 12, 2024
7216c24
Update add-checks.yml
Rakshithb1 Jan 12, 2024
62fa89f
Update add-checks.yml
Rakshithb1 Jan 12, 2024
2508db6
Update add-checks.yml
Rakshithb1 Jan 12, 2024
4828e13
Update add-checks.yml
Rakshithb1 Jan 12, 2024
9ed5b1c
Update add-checks.yml
Rakshithb1 Jan 12, 2024
df3791c
Update add-checks.yml
Rakshithb1 Jan 12, 2024
001f2f0
Update add-checks.yml
Rakshithb1 Jan 12, 2024
f3b81c7
Update add-checks.yml
Rakshithb1 Jan 12, 2024
a449933
Update add-checks.yml
Rakshithb1 Jan 12, 2024
4ecb719
Update add-checks.yml
Rakshithb1 Jan 12, 2024
967bf17
Update add-checks.yml
Rakshithb1 Jan 12, 2024
09cb550
Update add-checks.yml
Rakshithb1 Jan 12, 2024
c4649a5
Update add-checks.yml
Rakshithb1 Jan 12, 2024
705b8ac
Update add-checks.yml
Rakshithb1 Jan 12, 2024
c9ea48e
Update add-checks.yml
Rakshithb1 Jan 12, 2024
f26b7ba
Update add-checks.yml
Rakshithb1 Jan 12, 2024
9ec9451
Update add-checks.yml
Rakshithb1 Jan 12, 2024
dd4d1e5
Update add-checks.yml
Rakshithb1 Jan 12, 2024
609dc07
Update add-checks.yml
Rakshithb1 Jan 12, 2024
e52d433
Update add-checks.yml
Rakshithb1 Jan 12, 2024
bd6c000
Update add-checks.yml
Rakshithb1 Jan 12, 2024
c09dfe1
Update add-checks.yml
Rakshithb1 Jan 12, 2024
7670739
Update add-checks.yml
Rakshithb1 Jan 12, 2024
acacc8d
Update add-checks.yml
Rakshithb1 Jan 12, 2024
b3d1b1d
Update add-checks.yml
Rakshithb1 Jan 12, 2024
c5ec4ee
Update add-checks.yml
Rakshithb1 Jan 12, 2024
eb4245c
Update add-checks.yml
Rakshithb1 Jan 12, 2024
5b41a99
Update add-checks.yml
Rakshithb1 Jan 12, 2024
51e3cf6
Create check.csv
Rakshithb1 Jan 16, 2024
bf741d9
Update check.csv
Rakshithb1 Jan 16, 2024
4a72492
Update check.csv
Rakshithb1 Jan 16, 2024
6a21237
Create newcheck.yml
Rakshithb1 Jan 16, 2024
c78cc2b
Update newcheck.yml
Rakshithb1 Jan 16, 2024
423951e
Update newcheck.yml
Rakshithb1 Jan 16, 2024
508d00e
Update newcheck.yml
Rakshithb1 Jan 16, 2024
487306d
Update newcheck.yml
Rakshithb1 Jan 16, 2024
0e37aab
Update newcheck.yml
Rakshithb1 Jan 16, 2024
0f7307b
Update newcheck.yml
Rakshithb1 Jan 16, 2024
836bab8
Update newcheck.yml
Rakshithb1 Jan 16, 2024
3766720
Update newcheck.yml
Rakshithb1 Jan 16, 2024
c24c348
Update newcheck.yml
Rakshithb1 Jan 16, 2024
0fafa02
Update check.csv
Rakshithb1 Jan 16, 2024
e2b81f7
Update newcheck.yml
Rakshithb1 Jan 16, 2024
ffdaa31
Update newcheck.yml
Rakshithb1 Jan 16, 2024
a826e19
Update newcheck.yml
Rakshithb1 Jan 16, 2024
cfc50b0
Update newcheck.yml
Rakshithb1 Jan 16, 2024
b77592f
Update newcheck.yml
Rakshithb1 Jan 16, 2024
c887d1d
Update newcheck.yml
Rakshithb1 Jan 16, 2024
e1a2b47
Update newcheck.yml
Rakshithb1 Jan 16, 2024
3d785e3
Update newcheck.yml
Rakshithb1 Jan 16, 2024
f0f9c9e
Update check.csv
Rakshithb1 Jan 16, 2024
239f4e4
Update check.csv
Rakshithb1 Jan 16, 2024
1f08f73
Update newcheck.yml
Rakshithb1 Jan 16, 2024
1ad6038
Update newcheck.yml
Rakshithb1 Jan 16, 2024
fab2ee1
Update newcheck.yml
Rakshithb1 Jan 16, 2024
db9c258
Update check.csv
Rakshithb1 Jan 16, 2024
c935a93
Update check.csv
Rakshithb1 Jan 16, 2024
d300676
Update check.csv
Rakshithb1 Jan 16, 2024
2152c77
Update newcheck.yml
Rakshithb1 Jan 16, 2024
1963fc5
Update newcheck.yml
Rakshithb1 Jan 16, 2024
97e6ae0
Update newcheck.yml
Rakshithb1 Jan 16, 2024
5dbb828
Update newcheck.yml
Rakshithb1 Jan 16, 2024
28d2a06
Update newcheck.yml
Rakshithb1 Jan 16, 2024
5a0cde7
Update newcheck.yml
Rakshithb1 Jan 16, 2024
3a4090f
Update newcheck.yml
Rakshithb1 Jan 16, 2024
911fc79
Update newcheck.yml
Rakshithb1 Jan 16, 2024
a034b34
Update newcheck.yml
Rakshithb1 Jan 16, 2024
73c9f84
Update newcheck.yml
Rakshithb1 Jan 16, 2024
1b189b0
Update add-checks.yml
Rakshithb1 Jan 16, 2024
00a5e54
Update newcheck.yml
Rakshithb1 Jan 16, 2024
9b2e4a5
Update check.csv
Rakshithb1 Jan 16, 2024
142da06
Update check.csv
Rakshithb1 Jan 16, 2024
862729a
Merge branch 'mosip:develop' into develop
Rakshithb1 Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/add-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Add Branch Protection

on:
push:
branches:
- develop

jobs:
add-branch-protection:
runs-on: ubuntu-latest
env:
G_TOKEN: ${{ secrets.SSTOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: uuuu branch protection rule
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $G_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Rakshithb1/commons/branches/develop/protection/required_status_checks

3 changes: 3 additions & 0 deletions .github/workflows/check.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REPO,BRANCH,CHECKS
Rakshithb1/commons,develop,kernel-salt-generator / build-dockers
Rakshithb1/commons,develop,kernel-ridgenerator-service / build-dockers
57 changes: 57 additions & 0 deletions .github/workflows/newcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Require status checks to pass before merging

on:
workflow_dispatch:
inputs:
api_method:
description: 'Provide API method (Add, Get, Delete)'
required: true
default: ''
type: string

jobs:
status-checks:
runs-on: ubuntu-latest
env:
Status_TOKEN: ${{ secrets.SSTOKEN }}
CSV_LOCATION: .github/workflows/check.csv
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Add status checks
if: "${{ contains(github.event.inputs.api_method, 'Add') }}"
run: |
tail -n +2 $CSV_LOCATION | while IFS=, read -r REPO_NAME BRANCH_NAME CHECKS; do
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $Status_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$REPO_NAME/branches/$BRANCH_NAME/protection/required_status_checks/contexts" \
-d "{\"contexts\":[\"$CHECKS\"]}"
done

- name: Delete status checks
if: "${{ contains(github.event.inputs.api_method, 'Delete') }}"
run: |
tail -n +2 $CSV_LOCATION | while IFS=, read -r REPO_NAME BRANCH_NAME CHECKS; do
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $Status_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$REPO_NAME/branches/$BRANCH_NAME/protection/required_status_checks/contexts \
-d "{\"contexts\":[\"$CHECKS\"]}"
done

- name: Get status checks
if: "${{contains(github.event.inputs.api_method, 'Get') || github.event.inputs.api_method == 'Add' || github.event.inputs.api_method == 'Delete' }}"
run: |
tail -n +2 $CSV_LOCATION | while IFS=, read -r REPO_NAME BRANCH_NAME CHECKS; do
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $Status_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$REPO_NAME/branches/$BRANCH_NAME/protection/required_status_checks/contexts
done
4 changes: 2 additions & 2 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Maven Package upon a push
name: Maven Package upon a push

on:
release:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}"
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-commons
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
Expand Down
Loading