From e40f1d0dbf2163c99e3309d24bed68b928109fca Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:48:32 +0100 Subject: [PATCH 01/31] 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 6308ba54e32f4f55a6da14b943ec47ec75081b8f Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 21 Apr 2025 18:49:59 +0100 Subject: [PATCH 02/31] add schedule workflow --- .github/workflows/schedule.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/schedule.yml diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml new file mode 100644 index 000000000..4186413d9 --- /dev/null +++ b/.github/workflows/schedule.yml @@ -0,0 +1,10 @@ +on: + schedule: + - cron: '*/1 * * * *' + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: Echo current time + run: echo "The current server time is $(date)" From ec3cc2dbeb257106325e25a5e01fc90f142b4e6c Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:04:53 +0100 Subject: [PATCH 03/31] Shedule action working? --- .github/workflows/schedule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 4186413d9..9ae566778 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -1,6 +1,6 @@ on: schedule: - - cron: '*/1 * * * *' + - cron: '*/2 * * * *' jobs: hello_world: From 4e97be661ac4fd11a972e01ecb505ded824d0f8e Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:47:39 +0100 Subject: [PATCH 04/31] Multi event --- .github/workflows/multi-event.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/multi-event.yml diff --git a/.github/workflows/multi-event.yml b/.github/workflows/multi-event.yml new file mode 100644 index 000000000..a3275be38 --- /dev/null +++ b/.github/workflows/multi-event.yml @@ -0,0 +1,19 @@ +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" + echo "Action: $GITHUB_ACTION" + echo "Actor: $GITHUB_ACTOR" \ No newline at end of file From 4d602e6a22b48eb3039eb2de3693de4455b6286f Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Fri, 25 Apr 2025 12:18:12 +0000 Subject: [PATCH 05/31] Manual Workflow --- .github/workflows/manual.yml | 32 ++++++++++++++++++++++++++++++++ github-actions/data | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/manual.yml create mode 100644 github-actions/data 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/data b/github-actions/data new file mode 100644 index 000000000..1bea4a2ee --- /dev/null +++ b/github-actions/data @@ -0,0 +1 @@ +SGVsbG8gTWFycw== \ No newline at end of file From b6a6c52916a3222bdd512a0d1028298cc0bf64ee Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:52:31 +0000 Subject: [PATCH 06/31] TH --- .github/workflows/custom-action.yml | 15 -------------- .github/workflows/greetings.yml | 16 --------------- .github/workflows/manual.yml | 32 ----------------------------- .github/workflows/multi-event.yml | 19 ----------------- .github/workflows/schedule.yml | 10 --------- .github/workflows/webhook.yml | 15 ++++++++++++++ 6 files changed, 15 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/custom-action.yml delete mode 100644 .github/workflows/greetings.yml delete mode 100644 .github/workflows/manual.yml delete mode 100644 .github/workflows/multi-event.yml delete mode 100644 .github/workflows/schedule.yml create mode 100644 .github/workflows/webhook.yml diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml deleted file mode 100644 index 7a87b53f1..000000000 --- a/.github/workflows/custom-action.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: [push] - -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 deleted file mode 100644 index 081adf3a6..000000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,32 +0,0 @@ -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/workflows/multi-event.yml b/.github/workflows/multi-event.yml deleted file mode 100644 index a3275be38..000000000 --- a/.github/workflows/multi-event.yml +++ /dev/null @@ -1,19 +0,0 @@ -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" - echo "Action: $GITHUB_ACTION" - echo "Actor: $GITHUB_ACTOR" \ No newline at end of file diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml deleted file mode 100644 index 9ae566778..000000000 --- a/.github/workflows/schedule.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: - schedule: - - cron: '*/2 * * * *' - -jobs: - hello_world: - runs-on: ubuntu-latest - steps: - - name: Echo current time - run: echo "The current server time is $(date)" diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml new file mode 100644 index 000000000..b200d991f --- /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 97c761c7a4aab1ed81f1a19c0342016143326133 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:10:48 +0000 Subject: [PATCH 07/31] Try webhook workflow again --- .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 b200d991f..29cf0a721 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -12,4 +12,4 @@ jobs: - 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 c2a5684fd36921ac1a4e5b8ddb4de61b7e44e99d Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:15:05 +0000 Subject: [PATCH 08/31] Try webhook workflow again2 --- .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 29cf0a721..b200d991f 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -12,4 +12,4 @@ jobs: - 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 d250bbcb594dfa7168a484b9c0640ef5ddb6f7a9 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:23:10 +0000 Subject: [PATCH 09/31] Try webhook workflow again3 --- .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 b200d991f..29cf0a721 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -12,4 +12,4 @@ jobs: - 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 080e20eb76f4b18d8b92a74ebf765d8eca3f9d0f Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 12:39:40 +0000 Subject: [PATCH 10/31] Try webhook again 4 --- .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 29cf0a721..29c739fb5 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -12,4 +12,4 @@ jobs: - 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 47637029d598010a5a55ceb024f9d4e5304e7c04 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:34:19 +0000 Subject: [PATCH 11/31] conditional --- .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..87b48c2f9 --- /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 8dca890d0911a3e62a5fbc8c8a60d526892d5173 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:37:14 +0000 Subject: [PATCH 12/31] Else condition --- .github/workflows/conditional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml index 87b48c2f9..3909fecb5 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -2,7 +2,7 @@ name: example-workflow on: [push] jobs: hello-world: - if: github.repository == 'octo-org/octo-repo-prod' + if: github.repository == 'Github-Examples' runs-on: ubuntu-latest steps: - name: "Hello World" From c9af88fe0daf6e288a9b688ad04a22422b09c85e Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:38:43 +0000 Subject: [PATCH 13/31] Else Condition 2 --- .github/workflows/conditional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml index 3909fecb5..9b2d3b411 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -2,7 +2,7 @@ name: example-workflow on: [push] jobs: hello-world: - if: github.repository == 'Github-Examples' + if: github.repository == 'Roizz-soul/Github-Examples' runs-on: ubuntu-latest steps: - name: "Hello World" From 1e9b5bf6684472026f2b0d70250bc5bb8ba901fa Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:54:25 +0000 Subject: [PATCH 14/31] Expression Fuctions --- .github/workflows/conditional.yml | 14 -------- .github/workflows/expression-functions.yml | 37 ++++++++++++++++++++++ .github/workflows/webhook.yml | 15 --------- 3 files changed, 37 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/conditional.yml create mode 100644 .github/workflows/expression-functions.yml delete mode 100644 .github/workflows/webhook.yml diff --git a/.github/workflows/conditional.yml b/.github/workflows/conditional.yml deleted file mode 100644 index 9b2d3b411..000000000 --- a/.github/workflows/conditional.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: example-workflow -on: [push] -jobs: - hello-world: - if: github.repository == 'Roizz-soul/Github-Examples' - 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 diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml new file mode 100644 index 000000000..e213a386b --- /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 diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml deleted file mode 100644 index 29c739fb5..000000000 --- a/.github/workflows/webhook.yml +++ /dev/null @@ -1,15 +0,0 @@ -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 c5a4121cd434ae0281995c4460e414f016a5eb74 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:56:21 +0000 Subject: [PATCH 15/31] Expression Functions ex --- .github/workflows/expression-functions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index e213a386b..02c0ccf25 100644 --- a/.github/workflows/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 08cd90665ac5bc694c969ad62be3389e4eefcef7 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:00:29 +0000 Subject: [PATCH 16/31] Expression Function --- .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 02c0ccf25..f3f33b3e0 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 "Succeeded" - name: The job has failed - if: ${{ failure() }} \ No newline at end of file + if: ${{ failure() }} + run: echo "Failed" \ No newline at end of file From 71809da7554a85f233e65f447963f0614f5dbfa4 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:08:33 +0000 Subject: [PATCH 17/31] Expressions --- .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 f3f33b3e0..47c9d799c 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 "Succeeded" From 6c1fc7ff43f749b741980e6341df525e0a0564a4 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:29:15 +0000 Subject: [PATCH 18/31] Windos and Mac runner --- .github/workflows/runner-macos.yml | 30 ++++++++++++++++++++++ .github/workflows/runner-windows.yml | 38 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/runner-macos.yml create mode 100644 .github/workflows/runner-windows.yml diff --git a/.github/workflows/runner-macos.yml b/.github/workflows/runner-macos.yml new file mode 100644 index 000000000..6baa5adf6 --- /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 diff --git a/.github/workflows/runner-windows.yml b/.github/workflows/runner-windows.yml new file mode 100644 index 000000000..3b73f2b2e --- /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 From 7fbebb9a89e57d8e8761f5c9df22e9e0e8d46882 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:04:18 +0000 Subject: [PATCH 19/31] Self-hosted --- .github/workflows/runner-self-hosted.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/runner-self-hosted.yml diff --git a/.github/workflows/runner-self-hosted.yml b/.github/workflows/runner-self-hosted.yml new file mode 100644 index 000000000..23bb12e71 --- /dev/null +++ b/.github/workflows/runner-self-hosted.yml @@ -0,0 +1,17 @@ +# If you don't create a self-hosted runner you will see: +# Waiting for a runner to pick up this job... +name: Self-hosted Runner Workflow + +on: + push: + branches: + - main + +jobs: + example-job: + runs-on: self-hosted + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Run a one-line script + run: echo "Hello from a self-hosted runner!" \ No newline at end of file From 09b3bfe8df7b9795ad60d4be4c56673ceaec7de0 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:31:56 +0000 Subject: [PATCH 20/31] Workflow commands example --- .github/workflows/expression-functions.yml | 39 ---------------------- .github/workflows/runner-macos.yml | 30 ----------------- .github/workflows/runner-self-hosted.yml | 17 ---------- .github/workflows/runner-windows.yml | 38 --------------------- .github/workflows/workflow-commands.yml | 17 ++++++++++ 5 files changed, 17 insertions(+), 124 deletions(-) delete mode 100644 .github/workflows/expression-functions.yml delete mode 100644 .github/workflows/runner-macos.yml delete mode 100644 .github/workflows/runner-self-hosted.yml delete mode 100644 .github/workflows/runner-windows.yml create mode 100644 .github/workflows/workflow-commands.yml diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml deleted file mode 100644 index 47c9d799c..000000000 --- a/.github/workflows/expression-functions.yml +++ /dev/null @@ -1,39 +0,0 @@ -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() }} - run: echo "Succeeded" - - name: The job has failed - if: ${{ failure() }} - run: echo "Failed" \ No newline at end of file diff --git a/.github/workflows/runner-macos.yml b/.github/workflows/runner-macos.yml deleted file mode 100644 index 6baa5adf6..000000000 --- a/.github/workflows/runner-macos.yml +++ /dev/null @@ -1,30 +0,0 @@ -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 diff --git a/.github/workflows/runner-self-hosted.yml b/.github/workflows/runner-self-hosted.yml deleted file mode 100644 index 23bb12e71..000000000 --- a/.github/workflows/runner-self-hosted.yml +++ /dev/null @@ -1,17 +0,0 @@ -# If you don't create a self-hosted runner you will see: -# Waiting for a runner to pick up this job... -name: Self-hosted Runner Workflow - -on: - push: - branches: - - main - -jobs: - example-job: - runs-on: self-hosted - steps: - - name: Check out repository - uses: actions/checkout@v3 - - name: Run a one-line script - run: echo "Hello from a self-hosted runner!" \ No newline at end of file diff --git a/.github/workflows/runner-windows.yml b/.github/workflows/runner-windows.yml deleted file mode 100644 index 3b73f2b2e..000000000 --- a/.github/workflows/runner-windows.yml +++ /dev/null @@ -1,38 +0,0 @@ -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 diff --git a/.github/workflows/workflow-commands.yml b/.github/workflows/workflow-commands.yml new file mode 100644 index 000000000..fbff775a6 --- /dev/null +++ b/.github/workflows/workflow-commands.yml @@ -0,0 +1,17 @@ +name: "Workflow Commands" + +on: + push: + branches: + - main + +jobs: + my-job: + runs-on: ubuntu-latest + steps: + - name: "group logging" + run: | + echo "::group::My Group Messages" + echo "Message 1" + echo "Message 2" + echo "::endgroup::" \ No newline at end of file From f5d41651782f1b9a39d9ef20cf4d0a8071c070b4 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:36:00 +0000 Subject: [PATCH 21/31] Set env command --- .github/workflows/workflow-commands.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow-commands.yml b/.github/workflows/workflow-commands.yml index fbff775a6..6005b0fe9 100644 --- a/.github/workflows/workflow-commands.yml +++ b/.github/workflows/workflow-commands.yml @@ -14,4 +14,10 @@ jobs: echo "::group::My Group Messages" echo "Message 1" echo "Message 2" - echo "::endgroup::" \ No newline at end of file + echo "::endgroup::" + - name: "Step 1" + run: | + echo "MY_VAL=hello" >> $GITHUB_ENV + - name: "Step 2" + run: | + echo $MY_VAL \ No newline at end of file From 16e718890ff5c27231ead1ed84b2c41289646c97 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 16:41:54 +0000 Subject: [PATCH 22/31] Test Action Context --- .github/workflows/context.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/context.yml diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml new file mode 100644 index 000000000..5c2228086 --- /dev/null +++ b/.github/workflows/context.yml @@ -0,0 +1,12 @@ +name: Context Examples + +on: [push] + +jobs: + my-context: + runs-on: ubuntu-latest + steps: + - name: "My Step" + env: + MY_ACTION: ${{ github.action}} + run: echo "Hello! $MY_ACTION" \ No newline at end of file From 59478cf171c60f7f55c4a43b066735961cca5a80 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 16:48:55 +0000 Subject: [PATCH 23/31] Actor contect --- .github/workflows/context.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml index 5c2228086..ae3700431 100644 --- a/.github/workflows/context.yml +++ b/.github/workflows/context.yml @@ -9,4 +9,7 @@ jobs: - name: "My Step" env: MY_ACTION: ${{ github.action}} - run: echo "Hello! $MY_ACTION" \ No newline at end of file + MY_ACTOR: ${{ github.actor }} + run: | + echo "Hello! $MY_ACTION" + echo "Actor! $MY_ACTOR" \ No newline at end of file From b42b5db3e4b486c491a389dc9c0f2461a07de37e Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 16:59:04 +0000 Subject: [PATCH 24/31] Jobs workflow --- .github/workflows/jobs.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/jobs.yml diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml new file mode 100644 index 000000000..2d86b55b8 --- /dev/null +++ b/.github/workflows/jobs.yml @@ -0,0 +1,16 @@ +name: "Dep Jobs Example" + +on: [push] + +jobs: + job2: + runs-on: ubuntu-latest + needs: job1 + steps: + - name: stepA + run: echo "World" + job1: + runs-on: ubuntu-latest + steps: + - name: stepB + run: echo "Hello" \ No newline at end of file From 9529732ffb50c189cff3a170b62fb1c9fdcc1cd1 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:33:49 +0000 Subject: [PATCH 25/31] Custom actions --- .github/workflows/context.yml | 15 --------------- .github/workflows/custom-action.yml | 12 ++++++++++++ .github/workflows/jobs.yml | 16 ---------------- .github/workflows/workflow-commands.yml | 23 ----------------------- 4 files changed, 12 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/context.yml create mode 100644 .github/workflows/custom-action.yml delete mode 100644 .github/workflows/jobs.yml delete mode 100644 .github/workflows/workflow-commands.yml diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml deleted file mode 100644 index ae3700431..000000000 --- a/.github/workflows/context.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Context Examples - -on: [push] - -jobs: - my-context: - runs-on: ubuntu-latest - steps: - - name: "My Step" - env: - MY_ACTION: ${{ github.action}} - MY_ACTOR: ${{ github.actor }} - run: | - echo "Hello! $MY_ACTION" - echo "Actor! $MY_ACTOR" \ No newline at end of file diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml new file mode 100644 index 000000000..b87c72c8e --- /dev/null +++ b/.github/workflows/custom-action.yml @@ -0,0 +1,12 @@ +on: [push] + +jobs: + my_job: + runs-on: ubuntu-latest + name: A job to say hello + steps: + - name: Hello World action steps + id: hello + uses: Roizz-soul/barsoom@0.0.1 + with: + name: 'Barsoom' \ No newline at end of file diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml deleted file mode 100644 index 2d86b55b8..000000000 --- a/.github/workflows/jobs.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Dep Jobs Example" - -on: [push] - -jobs: - job2: - runs-on: ubuntu-latest - needs: job1 - steps: - - name: stepA - run: echo "World" - job1: - runs-on: ubuntu-latest - steps: - - name: stepB - run: echo "Hello" \ No newline at end of file diff --git a/.github/workflows/workflow-commands.yml b/.github/workflows/workflow-commands.yml deleted file mode 100644 index 6005b0fe9..000000000 --- a/.github/workflows/workflow-commands.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Workflow Commands" - -on: - push: - branches: - - main - -jobs: - my-job: - runs-on: ubuntu-latest - steps: - - name: "group logging" - run: | - echo "::group::My Group Messages" - echo "Message 1" - echo "Message 2" - echo "::endgroup::" - - name: "Step 1" - run: | - echo "MY_VAL=hello" >> $GITHUB_ENV - - name: "Step 2" - run: | - echo $MY_VAL \ No newline at end of file From 011dcde7eac35c1d3f658da800666d9918f16ea5 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:48:14 +0000 Subject: [PATCH 26/31] Check again --- github-actions/Readme.me | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github-actions/Readme.me b/github-actions/Readme.me index 9be613aad..e39db80aa 100644 --- a/github-actions/Readme.me +++ b/github-actions/Readme.me @@ -13,4 +13,5 @@ curl -X POST \ -H "Authorization: token {PAT} \ -d '{"event_type": "webhook", "client_payload": {"key": "value"} }' \ https://api.github.com/repos/{owner}/{repo}/dispatches -``` \ No newline at end of file +``` +Check \ No newline at end of file From 89848c9bdf30ca38d79a014ec90514df96d9c6b2 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:54:18 +0000 Subject: [PATCH 27/31] chech --- .github/workflows/custom-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index b87c72c8e..356abcc0c 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -3,7 +3,7 @@ on: [push] jobs: my_job: runs-on: ubuntu-latest - name: A job to say hello + name: A job for hello steps: - name: Hello World action steps id: hello From 1892ac84c0b01b73e1f2798df57c643259e19a05 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:56:46 +0000 Subject: [PATCH 28/31] check again --- .github/workflows/custom-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index 356abcc0c..d6406e674 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest name: A job for hello steps: - - name: Hello World action steps + - name: Hello World action steps try id: hello uses: Roizz-soul/barsoom@0.0.1 with: From 03df62b624af4073cf154ada13a21483f5e51152 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:59:06 +0000 Subject: [PATCH 29/31] Check 2 --- .github/workflows/custom-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index d6406e674..ea6407427 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -7,6 +7,6 @@ jobs: steps: - name: Hello World action steps try id: hello - uses: Roizz-soul/barsoom@0.0.1 + uses: Roizz-soul/barsoom@0.0.2 with: name: 'Barsoom' \ No newline at end of file From 144bbc6d6cafb444472d926a1cd55baaf822c299 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:24:47 +0100 Subject: [PATCH 30/31] lets see --- .github/workflows/custom-action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index ea6407427..28ccdadc8 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -9,4 +9,6 @@ jobs: id: hello uses: Roizz-soul/barsoom@0.0.2 with: - name: 'Barsoom' \ No newline at end of file + name: 'Brown' + - name: Get the output + run: echo "The time was ${{ steps.hello.outputs.greeting }}" \ No newline at end of file From ac1c5923bf123d6291404cff12f15299f991c612 Mon Sep 17 00:00:00 2001 From: Roizz-soul <106694609+Roizz-soul@users.noreply.github.com> Date: Mon, 28 Apr 2025 22:26:07 +0100 Subject: [PATCH 31/31] Again --- .github/workflows/custom-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index 28ccdadc8..c58e1115a 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Hello World action steps try id: hello - uses: Roizz-soul/barsoom@0.0.2 + uses: Roizz-soul/barsoom@0.04 with: name: 'Brown' - name: Get the output