From 35476b74c5f00a1a42178eba22e114b6a5fb369b Mon Sep 17 00:00:00 2001 From: v3locide Date: Mon, 10 Mar 2025 14:49:17 +0100 Subject: [PATCH 01/11] Create greetings.yml --- .github/workflows/greetings.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 000000000..46774343e --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,16 @@ +name: Greetings + +on: [pull_request_target, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "Message that will be displayed on users' first issue" + pr-message: "Message that will be displayed on users' first pull request" From 929732e1441d7d385191fad4eb8b6aa8cbc8256a Mon Sep 17 00:00:00 2001 From: v3locide Date: Mon, 10 Mar 2025 15:26:50 +0000 Subject: [PATCH 02/11] added scheduled workflow --- {github-actions/templates => .github/workflows}/schedule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {github-actions/templates => .github/workflows}/schedule.yml (86%) diff --git a/github-actions/templates/schedule.yml b/.github/workflows/schedule.yml similarity index 86% rename from github-actions/templates/schedule.yml rename to .github/workflows/schedule.yml index a88231de6..9ae566778 100644 --- a/github-actions/templates/schedule.yml +++ b/.github/workflows/schedule.yml @@ -1,6 +1,6 @@ on: schedule: - - cron: '*/5 * * * *' + - cron: '*/2 * * * *' jobs: hello_world: From bc6eb750e3b25203e51c6d59f762afb2af18bb7a Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 07:37:10 +0000 Subject: [PATCH 03/11] Added multi-event trigger --- {github-actions/templates => .github/workflows}/multi-event.yml | 2 ++ 1 file changed, 2 insertions(+) rename {github-actions/templates => .github/workflows}/multi-event.yml (92%) diff --git a/github-actions/templates/multi-event.yml b/.github/workflows/multi-event.yml similarity index 92% rename from github-actions/templates/multi-event.yml rename to .github/workflows/multi-event.yml index a3275be38..a5aade2de 100644 --- a/github-actions/templates/multi-event.yml +++ b/.github/workflows/multi-event.yml @@ -1,3 +1,5 @@ +name: Multi-event Trigger + on: push: branches: From 4abc93a3f752353943d652abb64158a7590c8205 Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 07:45:00 +0000 Subject: [PATCH 04/11] updated multi-event trigger --- .github/workflows/custom-action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index 7a87b53f1..a21d9a27e 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -1,4 +1,7 @@ -on: [push] +on: + push: + branches: + - main jobs: my-job: From 5dd01ecb4a20c699317564a5a3a126b874b1a720 Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 08:33:53 +0000 Subject: [PATCH 05/11] Added manual workflow --- .github/workflows/custom-action.yml | 18 ---------------- .github/workflows/greetings.yml | 16 --------------- .github/workflows/manual.yml | 32 +++++++++++++++++++++++++++++ github-actions/Readme.me | 2 +- github-actions/mydata | 2 +- 5 files changed, 34 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/custom-action.yml delete mode 100644 .github/workflows/greetings.yml create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml deleted file mode 100644 index a21d9a27e..000000000 --- a/.github/workflows/custom-action.yml +++ /dev/null @@ -1,18 +0,0 @@ -on: - push: - branches: - - main - -jobs: - my-job: - runs-on: ubuntu-latest - name: A job to say hello - steps: - - name: Hello world action step - id: hello - uses: omenking/barsoom@0.0.6 - with: - name: 'Brown' - # Use the output from the `hello` step - - name: Get the Output - run: echo "The time was ${{ steps.hello.outputs.greeting }}" \ No newline at end of file diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 46774343e..000000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Greetings - -on: [pull_request_target, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: "Message that will be displayed on users' first issue" - pr-message: "Message that will be displayed on users' first pull request" diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 000000000..081adf3a6 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,32 @@ +name: Manual Trigger with Params + +on: + workflow_dispatch: + inputs: + name: + description: 'Name of the person to greet' + required: true + type: string + greeting: + description: 'Type of greeting' + required: true + type: string + data: + description: 'Base64 encoded content of a file' + required: false + type: string + +jobs: + greet: + runs-on: ubuntu-latest + steps: + - name: Decode File Content + run: | + echo "${{ inputs.data }}" | base64 --decode > ./decoded_file.txt + - name: Display Greeting + run: | + echo "${{ inputs.greeting }}, ${{ inputs.name }}!" + - name: Display File Content + run: | + echo "Contents of the file:" + cat ./decoded_file.txt \ No newline at end of file diff --git a/github-actions/Readme.me b/github-actions/Readme.me index 9be613aad..4b66001f4 100644 --- a/github-actions/Readme.me +++ b/github-actions/Readme.me @@ -1,7 +1,7 @@ ## Manual Trigger ```sh -gh workflow run greet.yml -f name=mona -f greeting=hello -F data=@myfile.txt +gh workflow run manual.yml -f name=mona -f greeting=hello -F data=@mydata.txt echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json ``` diff --git a/github-actions/mydata b/github-actions/mydata index 1bea4a2ee..28e1eb5ec 100644 --- a/github-actions/mydata +++ b/github-actions/mydata @@ -1 +1 @@ -SGVsbG8gTWFycw== \ No newline at end of file +SGVsbG8gZnJvbSBHSCBBY3Rpb25zIQ== \ No newline at end of file From 7f2017516767f8eb9cc1a39c15decb2c10e154b4 Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 09:33:06 +0000 Subject: [PATCH 06/11] added webhook --- {github-actions/templates => .github/workflows}/webhook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {github-actions/templates => .github/workflows}/webhook.yml (72%) diff --git a/github-actions/templates/webhook.yml b/.github/workflows/webhook.yml similarity index 72% rename from github-actions/templates/webhook.yml rename to .github/workflows/webhook.yml index dbdf1e47d..bb989e410 100644 --- a/github-actions/templates/webhook.yml +++ b/.github/workflows/webhook.yml @@ -9,7 +9,7 @@ jobs: respond-to-dispatch: runs-on: ubuntu-latest steps: - - name Checkout repo + - name: Checkout repo uses: actions/checkout@v2 - name: Run a script - run: echo "Event of type: $GITHUB_EVENT_NAME" + run: echo "Event of type $GITHUB_EVENT_NAME" From 9962ba9f7b5bf220299055dfda40606889e0ad85 Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 15:56:08 +0000 Subject: [PATCH 07/11] added expression workflow --- .../workflows}/expression-functions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {github-actions/templates => .github/workflows}/expression-functions.yml (75%) diff --git a/github-actions/templates/expression-functions.yml b/.github/workflows/expression-functions.yml similarity index 75% rename from github-actions/templates/expression-functions.yml rename to .github/workflows/expression-functions.yml index e213a386b..8ca4e3a81 100644 --- a/github-actions/templates/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -24,13 +24,13 @@ jobs: run: echo ${{ format('Hello {0} {1} {2}', 'Mona', 'the', 'Octocat') }} - name: Join issue labels if: github.event_name == 'issues' - run: echo "Issue labels: ${{ join(github.event.issue.labels.*.name, ', ') }}" + run: echo "Issue labels ${{ join(github.event.issue.labels.*.name, ', ') }}" - name: Convert job context to JSON - run: echo "Job context in JSON: ${{ toJSON(github.job) }}" + run: 'echo "Job context in JSON: ${{ toJSON(github.job) }}"' - name: Parse JSON string - run: echo "Parsed JSON: ${{ fromJSON('{"hello":"world"}').hello }}" + run: echo "Parsed JSON ${{ fromJSON('{"hello":"world"}').hello }}" - name: Hash files - run: echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }} + run: echo "Hash of files ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }} - name: The job has succeeded if: ${{ success() }} - name: The job has failed From 1a2f9683ba8e84414d6c23e5fa7e30511937109c Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 15:57:56 +0000 Subject: [PATCH 08/11] updated expression workflow --- .github/workflows/expression-functions.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 8ca4e3a81..ee98f7bb3 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -33,5 +33,7 @@ jobs: run: echo "Hash of files ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }} - name: The job has succeeded if: ${{ success() }} + run: echo "Job ended successfully!" - name: The job has failed - if: ${{ failure() }} \ No newline at end of file + if: ${{ failure() }} + run: echo "Job failed with an error!" \ No newline at end of file From b2a19e51b5d939193c039a473ed9f64304efc482 Mon Sep 17 00:00:00 2001 From: v3locide Date: Tue, 11 Mar 2025 15:59:02 +0000 Subject: [PATCH 09/11] fixed hash expression syntax --- .github/workflows/expression-functions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index ee98f7bb3..2926dc0d3 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -30,7 +30,7 @@ jobs: - name: Parse JSON string run: echo "Parsed JSON ${{ fromJSON('{"hello":"world"}').hello }}" - name: Hash files - run: echo "Hash of files ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }} + run: echo "Hash of files ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}" - name: The job has succeeded if: ${{ success() }} run: echo "Job ended successfully!" From 92b7a4bb9144c4354098fa5b63faceb5526b1510 Mon Sep 17 00:00:00 2001 From: v3locide Date: Thu, 13 Mar 2025 09:37:26 +0000 Subject: [PATCH 10/11] added windows & macos runners --- .../templates => .github/workflows}/runner-macos.yml | 0 .../templates => .github/workflows}/runner-windows.yml | 6 ++---- .vscode/settings.json | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) rename {github-actions/templates => .github/workflows}/runner-macos.yml (100%) rename {github-actions/templates => .github/workflows}/runner-windows.yml (93%) create mode 100644 .vscode/settings.json diff --git a/github-actions/templates/runner-macos.yml b/.github/workflows/runner-macos.yml similarity index 100% rename from github-actions/templates/runner-macos.yml rename to .github/workflows/runner-macos.yml diff --git a/github-actions/templates/runner-windows.yml b/.github/workflows/runner-windows.yml similarity index 93% rename from github-actions/templates/runner-windows.yml rename to .github/workflows/runner-windows.yml index 3b73f2b2e..ec58a44d6 100644 --- a/github-actions/templates/runner-windows.yml +++ b/.github/workflows/runner-windows.yml @@ -2,11 +2,9 @@ name: Windows Workflow Example on: push: - branches: - - main + branches: ["main"] pull_request: - branches: - - main + branches: ["main"] jobs: build-and-test: diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..b242572ef --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] +} \ No newline at end of file From ebd9f7bce9500670cfe369c017d5ddd867d476cf Mon Sep 17 00:00:00 2001 From: v3locide Date: Thu, 10 Apr 2025 09:53:37 +0200 Subject: [PATCH 11/11] Create checkout-test.yml --- .github/workflows/checkout-test.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/checkout-test.yml diff --git a/.github/workflows/checkout-test.yml b/.github/workflows/checkout-test.yml new file mode 100644 index 000000000..bc0cdc0ab --- /dev/null +++ b/.github/workflows/checkout-test.yml @@ -0,0 +1,31 @@ +name : ci-cd for qcs test front-end + +on: + pull_request: + branches: + #- MechanicalTest-version-1.0 + - main + workflow_dispatch: + +env: + DEPLOY_SCRIPT_PATH: ./bashfiles/deploy_server.sh + UPGRADE_SCRIPT_PATH: ./bashfiles/upgrade_version.sh + DOCKERFILE_PATH: ./Dockerfile + SAVE_IMAGE_SCRIPT_PATH: ./bashfiles/save_image.sh + TERRAFORM_MAIN_PATH: terraform/main + BRANCH_NAME: MechanicalTest-version-1.0 + USER_GIT_EMAIL : mouhcene.abbassen@ge.com + USER_GIT_SSO : 260002392 + REPO_NAME: Base_Affaire_QCS + WORKING_DIRECTORY: Client + +jobs: + checkout-permissions-pushnewversion: + runs-on: self-hosted-linux +# container: +# image: docker.io/node:20-alpine + steps: + - name : checkout the code + uses : actions/checkout@v3 + - name : render files + run : ls