-
Notifications
You must be signed in to change notification settings - Fork 99
Develop #222
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
base: 1.2.0.1
Are you sure you want to change the base?
Develop #222
Changes from all commits
73df497
e9f9037
7f857fd
1f7254b
ae4d82f
083fb7e
0ecce6a
1e98c16
649eb38
f6d1f19
70d2a69
861abf3
60c7d8e
d35bce3
11fc657
2fa66d4
8f911b7
cdddb2f
0b741c4
f92d9b1
9aa2aa1
1379f2f
13f2d07
b379174
b032aed
6e2c3e0
aef1c08
dc27ab3
035e80a
4487217
0df1d2a
8123cd9
96bb5b0
2d9c2ce
f7d43d2
80bfdc8
2b91995
b5c975b
1e7f511
de6928f
7aa97a7
f3031cc
dc53b98
bba90c8
3c017bb
8d1f960
7edc5b5
04b4186
b90e5d3
516bd3d
6dfbf13
6af8c46
7b636b6
6180733
21486fc
409ac77
78523ed
d36ee7b
291624e
cfc0c03
c71882d
04df3d8
20087c9
6663f0f
55cd87c
b6d2fd6
2272794
1ca845b
85ff6b2
c402430
b88cd0c
fd0a34a
fe19259
30915d0
9b4e7c6
794e499
8bc8f82
51c2b7c
16fa0cb
92d0483
989c7b5
42eb0ad
18a4925
087a8a1
83aa54a
c47d403
f02cfa9
0433e27
d225b6d
1192006
be9ce61
0d6ccf4
4dddf21
1590a8b
6a8b33f
901a41b
05102af
3b16e06
286237b
9a1012e
335ba0a
799d092
06666c4
e75a408
da85459
a2eb990
ab9ab3b
061a247
b019ec6
784222b
f58c3ae
62a5884
ae305f7
98a0393
f3722e0
41be44b
1c0889a
fff9e9d
fb37615
04ddc9b
a7761f5
17b7436
83d5ca7
458e0d4
3b83a50
39992f4
9d75c37
1ecb235
f887d40
1072646
790f2f6
7c2af98
907bd6b
202b62b
971eef9
9f1aaab
a161c85
f8a3639
b150f0d
1df435a
ca9e54d
fd351bc
50f3a88
5f6b37b
7726eb4
29a6106
a4fe9bf
3672ba1
0a38c7f
9f639e5
af64a15
cdd2247
527f6fe
b77129a
485b6df
3d8c6d7
0e5ccff
3b5da67
231c356
2de9da1
ca41682
029925f
19a70af
a4b6a6b
d8db540
4fb3402
66bae35
8422c24
f0b1b8b
ac95e36
a7fbbf6
57d84e1
e03da3d
051dfbc
f155d0a
8b587f8
621c15a
4492e61
f753f96
6452bae
2f986ae
2bca234
996cba1
cfeb72f
ac688cb
624ab61
537e697
0bffae1
2a5f715
2d25d33
dee6ad0
658ed0f
55d67a9
0876b95
1f11dca
779e58b
184f3f5
a0fcb94
7709477
3e07e24
a972d74
59a86e2
b93f787
2592b25
399a6b2
f18be9a
9b60eca
969e481
dda94a0
b191cf4
e579bb6
aabdba0
6c850f5
d73a980
1ce7391
016171e
ec551c1
2398b89
1883c10
d445773
3000dc1
5461d23
dffb18b
480d388
f7ba130
8540113
3a05f26
4f92e17
acc24fb
304af91
29d1860
f6a27a8
4e2cad3
919ce76
85fccbb
494d709
076d552
99223f6
cc9b97e
d23636d
6bd4643
ab55fd4
64671be
60975de
c0e65d8
19a7ef9
53a7892
cd3e846
dcedef0
04b000f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| name: Setup Postgresql & Run postgres_init for MOSIP_Master & Run docker container | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| workflow_dispatch: | ||
| inputs: | ||
| message: | ||
| description: 'Message for manually triggering' | ||
| required: false | ||
| default: 'Triggered for Updates' | ||
| type: string | ||
| push: | ||
| branches: | ||
| - develop | ||
| - 1.2.0.1 | ||
| - MOSIP* | ||
| env: | ||
| DBUSER_PWD: mosip123 | ||
| SU_USER_PWD: abc123 | ||
| jobs: | ||
| setup-and-run: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v2 | ||
| - name: Create Docker Network | ||
| run: docker network create mosip_network | ||
| - name: Setup PostgreSQL Container | ||
| run: | | ||
| docker run -d \ | ||
| --name postgresql \ | ||
| --network mosip_network \ | ||
| -p 5432:5432 \ | ||
| -e POSTGRES_USER=postgres \ | ||
| -e POSTGRES_PASSWORD=${{ env.SU_USER_PWD }} \ | ||
| -e POSTGRES_HOST_AUTH_METHOD=trust \ | ||
| postgres:16 | ||
| - name: Initialise mosip_master DB | ||
| run: | | ||
| docker run -itd \ | ||
| --name mosip_master_container \ | ||
| --network mosip_network \ | ||
| -e MOSIP_DB_NAME=mosip_master \ | ||
| -e DB_SERVERIP=postgresql \ | ||
| -e DB_PORT=5432 \ | ||
| -e SU_USER=postgres \ | ||
| -e DML_FLAG=1 \ | ||
| -e GIT_REPO_URL=https://github.com/mosip/admin-services.git \ | ||
| -e GIT_BRANCH=develop \ | ||
| -e SU_USER_PWD=${{ env.SU_USER_PWD }} \ | ||
| -e DBUSER_PWD=${{ env.DBUSER_PWD }} \ | ||
| mosipdev/postgres-init:develop | ||
|
|
||
| - name: docker ps command | ||
| run: docker ps -a | ||
| - name: Print Logs of mosip_master | ||
| run: | | ||
| # Display mosip_master_container logs | ||
| docker logs -f mosip_master_container | ||
|
|
||
| - name: Check whether db_init has errors in Logs | ||
| run: | | ||
| if docker logs mosip_master_container | grep -qi "error"; then | ||
| echo "Error found in mosip_master_container logs." | ||
| exit 1 | ||
| else | ||
| echo "No errors found in mosip_master_container logs." | ||
| fi | ||
|
|
||
|
|
||
| - name: Set environment variables | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
| REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}" | ||
| BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
| else | ||
| REPO_URL="https://github.com/${{ github.repository }}.git" | ||
| BRANCH_NAME="${{ github.ref_name }}" | ||
| fi | ||
| echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV | ||
| echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV | ||
|
|
||
| - name: Run masterdata-loader | ||
| run: | | ||
| docker run -itd \ | ||
| --name masterdata_loader \ | ||
| --network mosip_network \ | ||
| -e DB_HOST=postgresql \ | ||
| -e DB_USER=masteruser \ | ||
| -e DB_PORT=5432 \ | ||
| -e DB_PWD=${{ env.DBUSER_PWD }} \ | ||
| -e REPOSITORY=${{ env.REPO_URL }}\ | ||
| -e BRANCH=${{ env.BRANCH_NAME }} \ | ||
| mosipdev/masterdata-loader:develop | ||
|
|
||
| - name: docker ps command | ||
| run: docker ps -a | ||
| - name: Print Logs of masterdata_loader | ||
| run: | | ||
| # Display masterdata_loader logs | ||
| docker logs -f masterdata_loader | ||
|
|
||
| - name: Check whether masterdata_loader has errors in Logs | ||
| run: | | ||
| if docker logs masterdata_loader | grep -qi "error"; then | ||
| echo "Error found in masterdata_loader logs." | ||
| exit 1 | ||
| else | ||
| echo "No errors found in masterdata_loader logs." | ||
| fi | ||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: xlsx to csv conversion | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request_target: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [opened, reopened, synchronize] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inputs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Message for manually triggering' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: 'Triggered for Updates' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| convert_xlsx_to_csv: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Clone the repository | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #git clone -b ${{ github.event.pull_request.head.ref }} "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Code injection Critical
Potential code injection in
${ github.event.pull_request.head.ref } Error loading related location Loading pull_request_target Error loading related location Loading
Copilot AutofixAI 26 days ago In general, the fix is to avoid using Concretely, we should:
We will modify:
No new imports or external packages are needed; we only change the YAML workflow configuration.
Suggested changeset
1
.github/workflows/xlsx-to-csv.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git clone -b ${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Code injection Critical
Potential code injection in
${ github.event.pull_request.head.ref } Error loading related location Loading pull_request_target Error loading related location Loading
Copilot AutofixAI 26 days ago In general, to fix code injection issues in GitHub Actions, you should avoid using untrusted expressions directly in For this workflow, the best targeted fix is to move
Suggested changeset
1
.github/workflows/xlsx-to-csv.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Get author email | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_NUMBER=${{ github.event.number }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commits=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -H "Accept: application/vnd.github.v3+json" \ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/commits") | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| email=$(echo "$commits" | jq -r '.[0].commit.author.email // "${{ github.event.pull_request.user.login }}@users.noreply.github.com"') | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "author_email=$email" >> $GITHUB_ENV | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Git identity | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config --global user.name "${{ github.event.pull_request.user.login }}" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config --global user.email "${{ env.author_email }}" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install xlsx2csv | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: sudo apt-get install -y xlsx2csv | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create output directory | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf mosip-data/mosip_master_csv/csv | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p mosip-data/mosip_master_csv/csv | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Convert all XLSX to CSV | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for xlsx_file in mosip-data/mosip_master/xlsx/*.xlsx; do | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| csv_file="mosip-data/mosip_master_csv/csv/$(basename "${xlsx_file%.xlsx}.csv")" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xlsx2csv "$xlsx_file" > "$csv_file" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Converted $xlsx_file to $csv_file" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Commit and push changes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd mosip-data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git branch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git add . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git commit -s -m "Added converted CSV files" || echo "No changes to commit" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git push "https://x-access-token:${{ secrets.ACTION_PAT }}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.event.pull_request.head.ref }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check failureCode scanning / CodeQL Code injection Critical
Potential code injection in
${ github.event.pull_request.head.ref } Error loading related location Loading pull_request_target Error loading related location Loading
Copilot AutofixAI 26 days ago Generally, to fix this class of problems in GitHub Actions, untrusted expressions like In this specific case, we should (1) move Concretely:
Suggested changeset
1
.github/workflows/xlsx-to-csv.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
Comment on lines
+16
to
+59
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 26 days ago In general, fix this by explicitly declaring a For this workflow, the steps only need to read repository contents and call GitHub’s REST API to read PR commits and metadata. All write operations to the repository use Concretely:
permissions:
contents: read
Suggested changeset
1
.github/workflows/xlsx-to-csv.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| .DS_Store | ||
| .idea | ||
| .project |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| THIRD-PARTY NOTICES | ||
|
|
||
| Copyright © MOSIP. | ||
| All rights reserved. | ||
|
|
||
| This project includes third-party components distributed under licenses | ||
| that require attribution. The following sections list those components | ||
| and their respective licenses. | ||
|
|
||
| =========================== | ||
| Mozilla Public License 2.0 | ||
| ========================== | ||
|
|
||
| • MOSIP Data (mosip-data) | ||
| Version: release-1.3.x | ||
| Homepage: [https://github.com/Rakshithasai123/mosip-data](https://github.com/Rakshithasai123/mosip-data) | ||
|
|
||
| =========================== | ||
| MIT License | ||
| =========== | ||
|
|
||
| • actions/checkout | ||
| Version: 2.*.* | ||
| Homepage: [https://github.com/actions/checkout](https://github.com/actions/checkout) | ||
|
|
||
| --- | ||
|
|
||
| Full license texts for all components are available in the | ||
| `license/` directory of this repository. | ||
| ---------------------------------------- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The MIT License (MIT) | ||
| --------------------------- | ||
| Copyright (c) 2019 GitHub, Inc. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 26 days ago
In general, the fix is to explicitly declare minimal
GITHUB_TOKENpermissions for this workflow or specific job(s) using apermissions:block, instead of relying on repository defaults. For a workflow that just checks out code and runs Docker/database commands,contents: readis sufficient for the entire workflow.The single best fix here is to add a top-level
permissions:block (so it applies to all jobs) withcontents: read. This does not change existing functionality, becauseactions/checkout@v2only requires read access to repository contents, and no steps modify GitHub resources. Concretely, in.github/workflows/push-trigger.yml, insert:between the
on:block and the existingenv:block (around current line 18). No imports, methods, or additional definitions are required, since this is purely a workflow configuration change.