From 6167d182de9a321c4062741acfc0eab9c341da1a Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:37:18 +0300 Subject: [PATCH 01/30] Create greetings.yml Greetings Actions --- .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 775f807bf1d7adc1e0f4d8f922af138be6609f53 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:50:16 +0300 Subject: [PATCH 02/30] created a schedule cron --- Workflows/schedule.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Workflows/schedule.yaml diff --git a/Workflows/schedule.yaml b/Workflows/schedule.yaml new file mode 100644 index 000000000..bc46612f4 --- /dev/null +++ b/Workflows/schedule.yaml @@ -0,0 +1,10 @@ +on: + schedule: + -cron: '*/1 * * *' + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: Echo current time + run: echo run: echo "The current server time is $(date)" \ No newline at end of file From 34f3b21b74b2ed2fbcbbcd5d83fba5531768e085 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:57:35 +0300 Subject: [PATCH 03/30] Add scheduled workflow to echo current server time A schedule workflow --- .github/workflows/schedule.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/schedule.yaml diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml new file mode 100644 index 000000000..f5111a54f --- /dev/null +++ b/.github/workflows/schedule.yaml @@ -0,0 +1,10 @@ +on: + schedule: + -cron: '*/1 * * *' + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: Echo current time + run: echo run: echo "The current server time is $(date)" From 1dee13cecfde4f70613c697dd2fb2b9df869843b Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:59:34 +0300 Subject: [PATCH 04/30] Update schedule.yaml Updated --- .github/workflows/schedule.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml index f5111a54f..2b8fb0c11 100644 --- a/.github/workflows/schedule.yaml +++ b/.github/workflows/schedule.yaml @@ -7,4 +7,4 @@ jobs: runs-on: ubuntu-latest steps: - name: Echo current time - run: echo run: echo "The current server time is $(date)" + run: echo "The current server time is $(date)" From 4ef7e662797e718f7b80e08ddb98d5e81e2eca4d Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:42:55 +0300 Subject: [PATCH 05/30] updated changes --- workflows/multi-event.yaml | 16 ++++++++++++++++ workflows/schedule.yaml | 10 ++++++++++ 2 files changed, 26 insertions(+) create mode 100644 workflows/multi-event.yaml create mode 100644 workflows/schedule.yaml diff --git a/workflows/multi-event.yaml b/workflows/multi-event.yaml new file mode 100644 index 000000000..13203432d --- /dev/null +++ b/workflows/multi-event.yaml @@ -0,0 +1,16 @@ +on: + push: + branches: + - main + - dev + pull_request: + branches: + main + jobs: + hello_world: + runs-on:ubuntu latest + steps: + - name: "Echo Basic Information" + run: + echo "REf: $GITHUB_REF " + echo "job id: $GITHUB_JOB" \ No newline at end of file diff --git a/workflows/schedule.yaml b/workflows/schedule.yaml new file mode 100644 index 000000000..bc46612f4 --- /dev/null +++ b/workflows/schedule.yaml @@ -0,0 +1,10 @@ +on: + schedule: + -cron: '*/1 * * *' + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: Echo current time + run: echo run: echo "The current server time is $(date)" \ No newline at end of file From 19df058f4f3c754cf887f31f419618c6efab32dd Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:46:31 +0300 Subject: [PATCH 06/30] updated --- workflows/multi-event.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/multi-event.yaml b/workflows/multi-event.yaml index 13203432d..e1091812b 100644 --- a/workflows/multi-event.yaml +++ b/workflows/multi-event.yaml @@ -8,7 +8,7 @@ on: main jobs: hello_world: - runs-on:ubuntu latest + runs-on: ubuntu latest steps: - name: "Echo Basic Information" run: From 3760bc991ef4915157f1465fce44996099b1198f Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:49:54 +0300 Subject: [PATCH 07/30] Fix cron syntax in schedule.yaml --- .github/workflows/schedule.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml index 2b8fb0c11..50c6b0d19 100644 --- a/.github/workflows/schedule.yaml +++ b/.github/workflows/schedule.yaml @@ -1,6 +1,6 @@ on: schedule: - -cron: '*/1 * * *' + - cron: '*/1 * * *' jobs: hello_world: From 568c589c5d64f042f43974f1fed92e2412a05ed7 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:51:28 +0300 Subject: [PATCH 08/30] Fix cron syntax in schedule.yaml --- .github/workflows/schedule.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml index 50c6b0d19..5d6995e62 100644 --- a/.github/workflows/schedule.yaml +++ b/.github/workflows/schedule.yaml @@ -1,6 +1,6 @@ on: schedule: - - cron: '*/1 * * *' + - cron: '*/1 * * * *' jobs: hello_world: From f6fa3179e70d161a7475545e74355d577fdf3801 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:54:00 +0300 Subject: [PATCH 09/30] created multi- event action --- {workflows => .github/workflows}/multi-event.yaml | 0 Workflows/schedule.yaml | 10 ---------- workflows/schedule.yaml | 10 ---------- 3 files changed, 20 deletions(-) rename {workflows => .github/workflows}/multi-event.yaml (100%) delete mode 100644 Workflows/schedule.yaml delete mode 100644 workflows/schedule.yaml diff --git a/workflows/multi-event.yaml b/.github/workflows/multi-event.yaml similarity index 100% rename from workflows/multi-event.yaml rename to .github/workflows/multi-event.yaml diff --git a/Workflows/schedule.yaml b/Workflows/schedule.yaml deleted file mode 100644 index bc46612f4..000000000 --- a/Workflows/schedule.yaml +++ /dev/null @@ -1,10 +0,0 @@ -on: - schedule: - -cron: '*/1 * * *' - -jobs: - hello_world: - runs-on: ubuntu-latest - steps: - - name: Echo current time - run: echo run: echo "The current server time is $(date)" \ No newline at end of file diff --git a/workflows/schedule.yaml b/workflows/schedule.yaml deleted file mode 100644 index bc46612f4..000000000 --- a/workflows/schedule.yaml +++ /dev/null @@ -1,10 +0,0 @@ -on: - schedule: - -cron: '*/1 * * *' - -jobs: - hello_world: - runs-on: ubuntu-latest - steps: - - name: Echo current time - run: echo run: echo "The current server time is $(date)" \ No newline at end of file From d92c7a84ad1c9f6aecd14f2be50e8a7a16df53a9 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:57:54 +0300 Subject: [PATCH 10/30] Update multi-event.yaml to include job ID echo Added job ID echo to the workflow. --- .github/workflows/multi-event.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multi-event.yaml b/.github/workflows/multi-event.yaml index e1091812b..2c913c109 100644 --- a/.github/workflows/multi-event.yaml +++ b/.github/workflows/multi-event.yaml @@ -5,7 +5,7 @@ on: - dev pull_request: branches: - main + - main jobs: hello_world: runs-on: ubuntu latest @@ -13,4 +13,4 @@ on: - name: "Echo Basic Information" run: echo "REf: $GITHUB_REF " - echo "job id: $GITHUB_JOB" \ No newline at end of file + echo "job id: $GITHUB_JOB" From 1e1bd16bd9f80b986e14d092c6ce015b184da8c9 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:59:37 +0300 Subject: [PATCH 11/30] Update CI workflow syntax and formatting --- .github/workflows/multi-event.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/multi-event.yaml b/.github/workflows/multi-event.yaml index 2c913c109..13c93a44a 100644 --- a/.github/workflows/multi-event.yaml +++ b/.github/workflows/multi-event.yaml @@ -1,3 +1,5 @@ +name: CI + on: push: branches: @@ -6,11 +8,12 @@ on: pull_request: branches: - main - jobs: - hello_world: - runs-on: ubuntu latest + +jobs: + hello_world: + runs-on: ubuntu-latest steps: - - name: "Echo Basic Information" - run: - echo "REf: $GITHUB_REF " - echo "job id: $GITHUB_JOB" + - name: Echo Basic Information + run: | + echo "Ref: $GITHUB_REF" + echo "Job id: $GITHUB_JOB" From da633ed2f75db5a92ad76c20b76c4fa0164cbbe1 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 15:04:56 +0300 Subject: [PATCH 12/30] Add scheduled job to echo current server time --- .github/workflows/schedule.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml index 5d6995e62..700fed02b 100644 --- a/.github/workflows/schedule.yaml +++ b/.github/workflows/schedule.yaml @@ -1,6 +1,8 @@ +name: Scheduled Job + on: schedule: - - cron: '*/1 * * * *' + - cron: '*/1 * * * *' # every 1 minute jobs: hello_world: From a313f56cfb0338f34d8570c7d2c234a07fd730d8 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:27:51 +0000 Subject: [PATCH 13/30] added manual worflows --- github-actions/mydata.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 github-actions/mydata.json diff --git a/github-actions/mydata.json b/github-actions/mydata.json new file mode 100644 index 000000000..b895666bf --- /dev/null +++ b/github-actions/mydata.json @@ -0,0 +1 @@ +SGVsbG8gbWFycw== \ No newline at end of file From e6c436fa4c5296e90c03184870e16fb1166d6244 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:28:13 +0000 Subject: [PATCH 14/30] manual workflow --- .github/workflows/manual.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/manual.yml 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 From 84d1c4edf6bb1efc64ca586d6b289d7d3cb2b5be Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:12:08 +0000 Subject: [PATCH 15/30] updated --- github-actions/manual.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 github-actions/manual.yml diff --git a/github-actions/manual.yml b/github-actions/manual.yml new file mode 100644 index 000000000..081adf3a6 --- /dev/null +++ b/github-actions/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 From 124b6f1acf2b6428dd4b1fa77b4fde04dcf8ea95 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:19:34 +0000 Subject: [PATCH 16/30] webhook action --- .github/workflows/webhook.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/webhook.yml diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml new file mode 100644 index 000000000..dbdf1e47d --- /dev/null +++ b/.github/workflows/webhook.yml @@ -0,0 +1,15 @@ +name: "Webhook Event example" + +on: + repository_dispatch: + types: + - webhook + +jobs: + respond-to-dispatch: + runs-on: ubuntu-latest + steps: + - name Checkout repo + uses: actions/checkout@v2 + - name: Run a script + run: echo "Event of type: $GITHUB_EVENT_NAME" From e50f93bd6c99dbfa48314874be2a414911f99881 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:26:13 +0000 Subject: [PATCH 17/30] fixed --- .github/workflows/webhook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index dbdf1e47d..b200d991f 100644 --- a/.github/workflows/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" From e6350f476522458d113e534636d3d32d5232c92c Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:31:02 +0000 Subject: [PATCH 18/30] Updated read me --- github-actions/Readme.me | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/github-actions/Readme.me b/github-actions/Readme.me index 9be613aad..babc94238 100644 --- a/github-actions/Readme.me +++ b/github-actions/Readme.me @@ -10,7 +10,11 @@ echo '{"name":"mona", "greeting":"hello"}' | gh workflow run greet.yml --json ```sh curl -X POST \ -H "Accept: application/vnd.github+json" \ --H "Authorization: token {PAT} \ +-H "Authorization: token {gh +p_Yb21g6bpDT9gQmuOVNMZoZBnxfXsFj4fxwMI} \ -d '{"event_type": "webhook", "client_payload": {"key": "value"} }' \ -https://api.github.com/repos/{owner}/{repo}/dispatches -``` \ No newline at end of file +https://github.com/repos/george00-byte/Github-Examples/dispatches +``` + + +https://api.github.com/repos/{owner}/{repo}/dispatches \ No newline at end of file From 13a873859ba792eac3580e47b03e83b05d8baaca Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:32:35 +0000 Subject: [PATCH 19/30] update webhook --- github-actions/templates/webhook.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/github-actions/templates/webhook.yml b/github-actions/templates/webhook.yml index dbdf1e47d..8d112e1aa 100644 --- a/github-actions/templates/webhook.yml +++ b/github-actions/templates/webhook.yml @@ -2,14 +2,14 @@ name: "Webhook Event example" on: repository_dispatch: - types: - - webhook + types: [webhook] jobs: respond-to-dispatch: runs-on: ubuntu-latest steps: - - name Checkout repo - uses: actions/checkout@v2 + - name: Checkout repo + uses: actions/checkout@v3 + - name: Run a script - run: echo "Event of type: $GITHUB_EVENT_NAME" + run: echo "Event of type: ${{ github.event_name }}" \ No newline at end of file From abce1ade1174bb2dc1952b03a707181b51e5b7ed Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:42:29 +0300 Subject: [PATCH 20/30] Update webhook.yml for improved syntax and version --- .github/workflows/webhook.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index b200d991f..259655c0c 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -2,14 +2,14 @@ name: "Webhook Event example" on: repository_dispatch: - types: - - webhook + types: [webhook] jobs: respond-to-dispatch: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Run a script - run: echo "Event of type: $GITHUB_EVENT_NAME" + run: echo "Event of type: ${{ github.event_name }}" From b73d7b68e41fd419e0bd695ef7d8fc856ace0e0b Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:46:08 +0300 Subject: [PATCH 21/30] Fix echo command in webhook.yml From cfdbed4f07150418165800fd9159942223a95d10 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:56:08 +0300 Subject: [PATCH 22/30] Update webhook.yml for repository_dispatch event --- .github/workflows/webhook.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index 259655c0c..87393485c 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -2,14 +2,12 @@ name: "Webhook Event example" on: repository_dispatch: - types: [webhook] + types: + - webhook jobs: respond-to-dispatch: runs-on: ubuntu-latest steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Run a script - run: echo "Event of type: ${{ github.event_name }}" + run: 'echo "Event of type: $GITHUB_EVENT_NAME"' From c4a0b483979a31031abc65036a78f9c5bc40998c Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 11:52:23 +0300 Subject: [PATCH 23/30] conditional statements --- .github/workflows/conditional.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/conditional.yml diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml new file mode 100644 index 000000000..a702cd8c5 --- /dev/null +++ b/.github/workflows/conditional.yml @@ -0,0 +1,14 @@ +name: example-workflow +on: [push] +jobs: + hello-world: + if: github.repository == 'octo-org/octo-repo-prod' + runs-on: ubuntu-latest + steps: + - name: "Hello World" + run: echo "Hello World!" + goodbye-moon: + runs-on: ubuntu-latest + steps: + - name: "Goodbye Moon" + run: echo "Goodbye Moon!" \ No newline at end of file From 15b2f31831390d696aefe183674f87b1f88897a0 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:19:52 +0300 Subject: [PATCH 24/30] conditional statements --- .github/workflows/expression-functions.yml | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/expression-functions.yml diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml new file mode 100644 index 000000000..60d301062 --- /dev/null +++ b/.github/workflows/expression-functions.yml @@ -0,0 +1,37 @@ +name: Expression Functions Demo + +on: + push: + branches: + - main + issues: + types: [opened, labeled] + +jobs: + expression-functions: + runs-on: ubuntu-latest + steps: + - name: Check if string contains substring + if: contains('Hello world', 'llo') + run: echo "The string contains the substring." + - name: Check if string starts with + if: startsWith('Hello world', 'He') + run: echo "The string starts with 'He'." + - name: Check if string ends with + if: endsWith('Hello world', 'ld') + run: echo "The string ends with 'ld'." + - name: Format and echo string + 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, ', ') }}" + - name: Convert job context to JSON + run: echo "Job context in JSON: ${{ toJSON(github.job) }}" + - 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') }} + - name: The job has succeeded + if: ${{ success() }} + - name: The job has failed + if: ${{ failure() }} \ No newline at end of file From 09fcef91d1d14a32ecb69bd51865e3172272081f Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:22:34 +0300 Subject: [PATCH 25/30] updated --- .github/workflows/expression-functions.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 60d301062..c693fe70b 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -14,24 +14,35 @@ jobs: - name: Check if string contains substring if: contains('Hello world', 'llo') run: echo "The string contains the substring." + - name: Check if string starts with if: startsWith('Hello world', 'He') run: echo "The string starts with 'He'." + - name: Check if string ends with if: endsWith('Hello world', 'ld') run: echo "The string ends with 'ld'." + - name: Format and echo string 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, ', ') }}" + - name: Convert job context to JSON 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() }} + run: echo "Job succeeded" + - name: The job has failed - if: ${{ failure() }} \ No newline at end of file + if: ${{ failure() }} + run: echo "Job failed" \ No newline at end of file From caa262a235b9062d399b19e274569c1cf90d4398 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:24:37 +0300 Subject: [PATCH 26/30] updated --- .github/workflows/expression-functions.yml | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index c693fe70b..0b6a7c1d7 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -15,34 +15,34 @@ jobs: if: contains('Hello world', 'llo') run: echo "The string contains the substring." + - name: Check if string ends with + if: endsWith('Hello world', 'ld') + run: echo "The string ends with 'ld'." + - name: Check if string starts with if: startsWith('Hello world', 'He') run: echo "The string starts with 'He'." - - name: Check if string ends with - if: endsWith('Hello world', 'ld') - run: echo "The string ends with 'ld'." + - name: Convert job context to JSON + run: echo "Job context in JSON: ${{ toJSON(github.job) }}" - name: Format and echo string run: echo ${{ format('Hello {0} {1} {2}', 'Mona', 'the', 'Octocat') }} + - name: Hash files + run: echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}" + - name: Join issue labels if: github.event_name == 'issues' 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) }}" - - 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') }}" + - name: The job has failed + if: ${{ failure() }} + run: echo "Job failed" - name: The job has succeeded if: ${{ success() }} - run: echo "Job succeeded" - - - name: The job has failed - if: ${{ failure() }} - run: echo "Job failed" \ No newline at end of file + run: echo "Job succeeded" \ No newline at end of file From 96749416e6d75aa0665735d0b3a1ee0fa5ffec70 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:26:23 +0300 Subject: [PATCH 27/30] expression functions --- .github/workflows/expression-functions.yml | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 0b6a7c1d7..87baccbd0 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -15,34 +15,39 @@ jobs: if: contains('Hello world', 'llo') run: echo "The string contains the substring." - - name: Check if string ends with - if: endsWith('Hello world', 'ld') - run: echo "The string ends with 'ld'." - - name: Check if string starts with if: startsWith('Hello world', 'He') run: echo "The string starts with 'He'." - - name: Convert job context to JSON - run: echo "Job context in JSON: ${{ toJSON(github.job) }}" + - name: Check if string ends with + if: endsWith('Hello world', 'ld') + run: echo "The string ends with 'ld'." - name: Format and echo string - run: echo ${{ format('Hello {0} {1} {2}', 'Mona', 'the', 'Octocat') }} - - - name: Hash files - run: echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}" + 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) }}" - name: Parse JSON string - run: echo 'Parsed JSON: ${{ fromJSON("{\"hello\":\"world\"}").hello }}' + run: | + echo 'Parsed JSON: ${{ fromJSON("{\"hello\":\"world\"}").hello }}' - - name: The job has failed - if: ${{ failure() }} - run: echo "Job failed" + - name: Hash files + run: | + echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}" - name: The job has succeeded if: ${{ success() }} - run: echo "Job succeeded" \ No newline at end of file + run: echo "Job succeeded" + + - name: The job has failed + if: ${{ failure() }} + run: echo "Job failed" \ No newline at end of file From 37337d77dd28848e312c898f1957486c38ec2905 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:29:55 +0300 Subject: [PATCH 28/30] updated --- .github/workflows/expression-functions.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 87baccbd0..fedef1bf6 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -24,8 +24,7 @@ jobs: run: echo "The string ends with 'ld'." - name: Format and echo string - run: | - echo ${{ format('Hello {0} {1} {2}', 'Mona', 'the', 'Octocat') }} + run: echo "Hello Mona the Octocat" - name: Join issue labels if: github.event_name == 'issues' @@ -38,16 +37,16 @@ jobs: - name: Parse JSON string run: | - echo 'Parsed JSON: ${{ fromJSON("{\"hello\":\"world\"}").hello }}' + echo "Parsed JSON: world" - name: Hash files run: | echo "Hash of files: ${{ hashFiles('**/package-lock.json', '**/Gemfile.lock') }}" - name: The job has succeeded - if: ${{ success() }} + if: success() run: echo "Job succeeded" - name: The job has failed - if: ${{ failure() }} + if: failure() run: echo "Job failed" \ No newline at end of file From 3ef44564b02a9f1b3fe40de4136a932110e90502 Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:21:33 +0300 Subject: [PATCH 29/30] run on macOS --- .github/workflows/runner-macos.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/runner-macos.yml diff --git a/.github/workflows/runner-macos.yml b/.github/workflows/runner-macos.yml new file mode 100644 index 000000000..9863ad486 --- /dev/null +++ b/.github/workflows/runner-macos.yml @@ -0,0 +1,30 @@ +name: macOS Workflow Example + +on: + push: + branches: + - main + +jobs: + build-and-test: + runs-on: macos-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Create Swift File + run: | + echo 'print("Hello from Swift on macOS")' > hello.swift + + - name: Install dependencies + run: | + brew install swiftlint + + - name: Run SwiftLint + run: swiftlint + + - name: Compile and run Swift program + run: | + swiftc hello.swift + ./hello \ No newline at end of file From 988daed430bcebe71ed55b204f8114f3d766646d Mon Sep 17 00:00:00 2001 From: George Odhiambo <84243038+george00-byte@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:28:48 +0300 Subject: [PATCH 30/30] runner onwindows --- .github/workflows/runner-windows.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/runner-windows.yml diff --git a/.github/workflows/runner-windows.yml b/.github/workflows/runner-windows.yml new file mode 100644 index 000000000..389ccefe2 --- /dev/null +++ b/.github/workflows/runner-windows.yml @@ -0,0 +1,38 @@ +name: Windows Workflow Example + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: choco install dotnetcore-sdk + shell: powershell + + - name: Compile and run C# program + run: | + Add-Content -Path "Hello.cs" -Value @" + using System; + public class Hello + { + public static void Main() + { + Console.WriteLine("Hello, Windows from C#"); + } + } + "@ + dotnet new console --force --no-restore + Move-Item -Path "Hello.cs" -Destination "Program.cs" -Force + dotnet run + shell: powershell \ No newline at end of file