From f999ec8d2abac07085758591cd69d35c471e3b48 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:15:11 +0100 Subject: [PATCH 01/36] 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 82693de80760c2725127b29328e9d4759ac50171 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:27:30 +0100 Subject: [PATCH 02/36] deleted the example yaml files --- .github/workflows/custom-action.yml | 15 --------------- .github/workflows/greetings.yml | 16 ---------------- 2 files changed, 31 deletions(-) delete mode 100644 .github/workflows/custom-action.yml delete mode 100644 .github/workflows/greetings.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" From 36ad1ff4faacad866491c57d5295d75706efbf67 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:52:54 +0100 Subject: [PATCH 03/36] add schedule work flow --- {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..4186413d9 100644 --- a/github-actions/templates/schedule.yml +++ b/.github/workflows/schedule.yml @@ -1,6 +1,6 @@ on: schedule: - - cron: '*/5 * * * *' + - cron: '*/1 * * * *' jobs: hello_world: From 49bd6ce80daecbdf7522277b36f970453997f1e8 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:12:01 +0100 Subject: [PATCH 04/36] renamed workflow to scheduled event --- .github/workflows/schedule.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 4186413d9..483fc32da 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -1,3 +1,4 @@ +name: scheduled events on: schedule: - cron: '*/1 * * * *' From feb6f5d5a7e3b15eb87f372f4986edeeaef90de9 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:19:08 +0000 Subject: [PATCH 05/36] moved multievents in github workflows --- {github-actions/templates => .github/workflows}/multi-event.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {github-actions/templates => .github/workflows}/multi-event.yml (100%) diff --git a/github-actions/templates/multi-event.yml b/.github/workflows/multi-event.yml similarity index 100% rename from github-actions/templates/multi-event.yml rename to .github/workflows/multi-event.yml From e80c8ca0470cf38e83fff8d911acbe186cdae142 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:22:02 +0000 Subject: [PATCH 06/36] updated name in github workflows --- .github/workflows/multi-event.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/multi-event.yml b/.github/workflows/multi-event.yml index a3275be38..2e9fb1374 100644 --- a/.github/workflows/multi-event.yml +++ b/.github/workflows/multi-event.yml @@ -1,3 +1,4 @@ +name: multi-event on: push: branches: From dc48c7367e4401655c83d895b3ffc7f9ebf297e0 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:26:47 +0000 Subject: [PATCH 07/36] added manual events --- .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 e197e706f1732c6c3b3f4e76b49d8b3f519582aa Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:53:05 +0000 Subject: [PATCH 08/36] webhooks --- .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 19d36b4caca9b87bacc5346cf2edc289ac9f1372 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:54:51 +0000 Subject: [PATCH 09/36] renamed workflow --- .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..82d66d5bd 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -1,4 +1,4 @@ -name: "Webhook Event example" +name: Webhook Event example on: repository_dispatch: From 1b3e66ca3fd42cc8edd7b9240a038c265cfc007b Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:58:38 +0000 Subject: [PATCH 10/36] added semicolon --- .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 82d66d5bd..ff4449564 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 6e6390085037ae635ed554cc7731d91c5aae7515 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:34:59 +0000 Subject: [PATCH 11/36] formatted --- .github/workflows/webhook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index ff4449564..bbf34b782 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -11,5 +11,5 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 - - name: Run a script - run: echo "Event of type: $GITHUB_EVENT_NAME" + - name: "Run a script" + run: 'echo "Event of type: $GITHUB_EVENT_NAME"' From e3fbe93f4868f2e9dcc55bdf372a58385ac8de82 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:27:08 +0000 Subject: [PATCH 12/36] 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 8dcd2fa39ad82099202402c978dc30893d9ecdb2 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:28:04 +0000 Subject: [PATCH 13/36] name --- .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..e7d438dac 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -1,4 +1,4 @@ -name: example-workflow +name: conditional-example-workflow on: [push] jobs: hello-world: From c87743f3446aefbffb37faf15178419e625edf85 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:31:39 +0000 Subject: [PATCH 14/36] condtional modified --- .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 e7d438dac..19f035c1c 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -2,7 +2,7 @@ name: conditional-example-workflow on: [push] jobs: hello-world: - if: github.repository == 'octo-org/octo-repo-prod' + if: github.repository == 'chaitu092/Github-Examples' runs-on: ubuntu-latest steps: - name: "Hello World" From 68e54ef28f29506d5dba6c2389fc34ea1df1d40e Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:02:47 +0000 Subject: [PATCH 15/36] expressions --- .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..1d84a4319 --- /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 e7562227c1fc36e73f43f04018011bf915b7953f Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:12:49 +0000 Subject: [PATCH 16/36] modified --- .github/workflows/expression-functions.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 1d84a4319..6b47ab350 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -26,12 +26,14 @@ jobs: 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) }}" + 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 "SUCCESS!" - name: The job has failed - if: ${{ failure() }} \ No newline at end of file + if: ${{ failure() }} + run: echo "Failure!" \ No newline at end of file From cb6ee3a1d4f2df47c1b502c533a75b7642652c3d Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:14:59 +0000 Subject: [PATCH 17/36] modified changes --- .github/workflows/expression-functions.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 6b47ab350..57f10e2e0 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -22,9 +22,6 @@ jobs: 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 From 375b1ed56338a9271410253bc581dbcd6930985f Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:20:26 +0100 Subject: [PATCH 18/36] neccesary changes --- .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 57f10e2e0..087c7beac 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -25,7 +25,7 @@ jobs: - 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') }}\"" - name: The job has succeeded From f8a9fbcfcc28aac934fd04aadfdda84ddbd5d179 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:21:37 +0100 Subject: [PATCH 19/36] removed issues --- .github/workflows/expression-functions.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/expression-functions.yml b/.github/workflows/expression-functions.yml index 087c7beac..fe92bbb2a 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -4,8 +4,6 @@ on: push: branches: - main - issues: - types: [opened, labeled] jobs: expression-functions: From a51329261a08ca1666a5060e05c9928a13684ce3 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:37:35 +0100 Subject: [PATCH 20/36] modified slash --- .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 fe92bbb2a..ad80f01df 100644 --- a/.github/workflows/expression-functions.yml +++ b/.github/workflows/expression-functions.yml @@ -23,7 +23,7 @@ jobs: - 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') }}\"" - name: The job has succeeded From 4109ab33fe9d5881e0e332614a73667b00371a20 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:16:33 +0100 Subject: [PATCH 21/36] runners for macos and windows --- .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 a34e91144e62fb3b3bec280b6a46b2ab7625cd3d Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:45:15 +0000 Subject: [PATCH 22/36] commit self hosted runner --- .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 f56d6939ac8b955d0a1097e6b4bd726bf7b7db3c Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:30:45 +0000 Subject: [PATCH 23/36] workflow commands example --- .github/workflows/workflow.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 000000000..04381d9fd --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,16 @@ +name: Worflow Commands + +on: + push: + branches: + - main +jobs: + my-job: + runs-on: ubuntu-latest + steps: + - name: "group logging" + run: | + echo "::group:: My Group Message" + echo "Msg 1" + echo "Msg 2" + echo "::endgroup::" \ No newline at end of file From a4d4b3310b93ffa9d25d0d39ca5dd20c3c643dd1 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:37:05 +0000 Subject: [PATCH 24/36] printing github env --- .github/workflows/workflow.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 04381d9fd..830e5dc0e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -13,4 +13,14 @@ jobs: echo "::group:: My Group Message" echo "Msg 1" echo "Msg 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 87121dfb3cf31346e87178c762ef8c01f50ed4a9 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:48:20 +0000 Subject: [PATCH 25/36] context example --- .github/workflows/context.yml | 16 ++++++++++++++++ 1 file changed, 16 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..a3d2abc46 --- /dev/null +++ b/.github/workflows/context.yml @@ -0,0 +1,16 @@ +name: Context examples + +on: + push: + branches: + - main + +jobs: + my_context: + run-on: ubuntu-latest + steps: + env: + + MY_ACTION: ${{ github.action }} + - name: "My step" + run: echo "Hello! $MY_ACTION" \ No newline at end of file From 2834a3dc3af03a8694e191fbd9cc4fe925bd3757 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:49:29 +0000 Subject: [PATCH 26/36] corrected run command --- .github/workflows/context.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml index a3d2abc46..c52ad14a5 100644 --- a/.github/workflows/context.yml +++ b/.github/workflows/context.yml @@ -7,7 +7,7 @@ on: jobs: my_context: - run-on: ubuntu-latest + runs-on: ubuntu-latest steps: env: From 7dbf721dd2dd8be83e8593a8c958f23ccc71d38e Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:51:07 +0000 Subject: [PATCH 27/36] reset the step --- .github/workflows/context.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml index c52ad14a5..cdcfd8836 100644 --- a/.github/workflows/context.yml +++ b/.github/workflows/context.yml @@ -9,8 +9,7 @@ jobs: my_context: runs-on: ubuntu-latest steps: - env: - - MY_ACTION: ${{ github.action }} - name: "My step" - run: echo "Hello! $MY_ACTION" \ No newline at end of file + run: echo "Hello! $MY_ACTION" + env: + MY_ACTION: ${{ github.action }} \ No newline at end of file From 2dee1a03d0535907ef0dcf83b63be54d31bea09e Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:55:05 +0000 Subject: [PATCH 28/36] second step --- .github/workflows/context.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/context.yml b/.github/workflows/context.yml index cdcfd8836..30fb228ef 100644 --- a/.github/workflows/context.yml +++ b/.github/workflows/context.yml @@ -11,5 +11,10 @@ jobs: steps: - name: "My step" run: echo "Hello! $MY_ACTION" + env: + MY_ACTION: ${{ github.action }} + + - name: "My second step" + run: echo "bye! $MY_ACTION" env: MY_ACTION: ${{ github.action }} \ No newline at end of file From 53560faf61ae76e19dd75c54620c7d7341ce7e85 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:46:37 +0000 Subject: [PATCH 29/36] jonbs workflow example --- .github/workflows/jobs.yml | 18 ++++++++++++++++++ 1 file changed, 18 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..bac218bee --- /dev/null +++ b/.github/workflows/jobs.yml @@ -0,0 +1,18 @@ +name: Jobsssss + +on: + push: + branches: + - main + +jobs: + job2: + runs-on: ubuntu-latest + needs: job1 + steps: + - name: step1 + run: echo "Sai" + job1: + steps: + - name: stepB + run: echo "Hello" \ No newline at end of file From 2b600f768d6814bff09947bdafcd0bd10b9db726 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:47:30 +0000 Subject: [PATCH 30/36] adjusted syntax --- .github/workflows/jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index bac218bee..b7a989456 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -7,7 +7,7 @@ on: jobs: job2: - runs-on: ubuntu-latest + runs-on: ubuntu-latest needs: job1 steps: - name: step1 From 9001de9deccfaf3be7c5c50bc4f6ef3c2bcf744a Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:48:36 +0000 Subject: [PATCH 31/36] updated env --- .github/workflows/jobs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index b7a989456..d10459bcf 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -13,6 +13,7 @@ jobs: - name: step1 run: echo "Sai" job1: + runs-on: ubuntu-latest steps: - name: stepB run: echo "Hello" \ No newline at end of file From 9b4964354b7b7bbfc33136372b3bb8d787ce8406 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:50:13 +0000 Subject: [PATCH 32/36] syntax --- .github/workflows/jobs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index d10459bcf..a30d541d0 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -11,9 +11,9 @@ jobs: needs: job1 steps: - name: step1 - run: echo "Sai" + run: echo "Saiii" job1: runs-on: ubuntu-latest steps: - name: stepB - run: echo "Hello" \ No newline at end of file + run: echo "Hello" \ No newline at end of file From 4664cf09ef09fd19c1ded9fc6b68d1d17d74c227 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:56:52 +0000 Subject: [PATCH 33/36] created jobs without depends --- .github/workflows/jobs-withoutdepends.yml | 19 +++++++++++++++++++ .github/workflows/jobs.yml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/jobs-withoutdepends.yml diff --git a/.github/workflows/jobs-withoutdepends.yml b/.github/workflows/jobs-withoutdepends.yml new file mode 100644 index 000000000..d5b02bae9 --- /dev/null +++ b/.github/workflows/jobs-withoutdepends.yml @@ -0,0 +1,19 @@ +name: Jobs withoit depends + +on: + push: + branches: + - main + +jobs: + job2: + runs-on: ubuntu-latest + steps: + - name: stepA + run echo "Chaitu" + + job1: + runs-on:ubuntu-latest + steps: + - name: stepB + run echo "Hi" \ No newline at end of file diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index a30d541d0..ef0651de2 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest needs: job1 steps: - - name: step1 + - name: stepA run: echo "Saiii" job1: runs-on: ubuntu-latest From 2cc8504c372276b2a56b901de3694cc9dd1bc6ac Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:58:39 +0000 Subject: [PATCH 34/36] syntax --- .github/workflows/jobs-withoutdepends.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/jobs-withoutdepends.yml b/.github/workflows/jobs-withoutdepends.yml index d5b02bae9..986142bfd 100644 --- a/.github/workflows/jobs-withoutdepends.yml +++ b/.github/workflows/jobs-withoutdepends.yml @@ -1,4 +1,4 @@ -name: Jobs withoit depends +name: Jobs without depends on: push: @@ -9,11 +9,11 @@ jobs: job2: runs-on: ubuntu-latest steps: - - name: stepA - run echo "Chaitu" + - name: stepA + run echo "Chaitu" job1: runs-on:ubuntu-latest steps: - - name: stepB - run echo "Hi" \ No newline at end of file + - name: stepB + run echo "Hi" \ No newline at end of file From 1190f1567b47e4f1b18d28ce1304361260913bf7 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:00:29 +0000 Subject: [PATCH 35/36] run syntax --- .github/workflows/jobs-withoutdepends.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jobs-withoutdepends.yml b/.github/workflows/jobs-withoutdepends.yml index 986142bfd..a42c69d88 100644 --- a/.github/workflows/jobs-withoutdepends.yml +++ b/.github/workflows/jobs-withoutdepends.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - name: stepA - run echo "Chaitu" + run: echo "Chaitu" job1: runs-on:ubuntu-latest steps: - name: stepB - run echo "Hi" \ No newline at end of file + run: echo "Hi" \ No newline at end of file From 5b7d40bdcac524e3bf7f5eccb6b9f69697bf6e80 Mon Sep 17 00:00:00 2001 From: ELA SAI CHAITANYA <46320744+chaitu092@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:03:44 +0000 Subject: [PATCH 36/36] spaces --- .github/workflows/jobs-withoutdepends.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jobs-withoutdepends.yml b/.github/workflows/jobs-withoutdepends.yml index a42c69d88..8d96bcf1f 100644 --- a/.github/workflows/jobs-withoutdepends.yml +++ b/.github/workflows/jobs-withoutdepends.yml @@ -13,7 +13,7 @@ jobs: run: echo "Chaitu" job1: - runs-on:ubuntu-latest + runs-on: ubuntu-latest steps: - name: stepB run: echo "Hi" \ No newline at end of file