From e6469f31beaefddcd8987f5d95e62da841e98ebc Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 11:50:24 +0530 Subject: [PATCH 01/40] 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 94f323405daf2320198c4c75a21765ea50e2d638 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 11:55:41 +0530 Subject: [PATCH 02/40] Update greetings.yml --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 46774343e..b0c7e60f7 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: [pull_request_target, issues] +on: [push] jobs: greeting: From 47d6a9a2e4b12618e1c05d477af9aa7b873960d7 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 12:01:50 +0530 Subject: [PATCH 03/40] Update greetings.yml --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index b0c7e60f7..ef29b5620 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: [push] +on: push jobs: greeting: From 878a29a12c3ed9771dcd615f29e105d48a5e1070 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 12:13:26 +0530 Subject: [PATCH 04/40] Update custom-action.yml --- .github/workflows/custom-action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index 7a87b53f1..7b9094aa5 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -1,5 +1,5 @@ -on: [push] - +on: + workflow_dispatch: jobs: my-job: runs-on: ubuntu-latest @@ -12,4 +12,4 @@ jobs: 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 + run: echo "The time was ${{ steps.hello.outputs.greeting }}" From 1d78935b050da0f2261651a3a541f66a634d16aa Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 12:14:20 +0530 Subject: [PATCH 05/40] Update greetings.yml --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index ef29b5620..4baef03c6 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: push +on: [issues] jobs: greeting: From 1c8a0f3fb1a89d294818fb9f824f66099d1782ef Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 14:26:27 +0530 Subject: [PATCH 06/40] Create repo-dispatch.yml --- .github/workflows/repo-dispatch.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/repo-dispatch.yml diff --git a/.github/workflows/repo-dispatch.yml b/.github/workflows/repo-dispatch.yml new file mode 100644 index 000000000..07aae5013 --- /dev/null +++ b/.github/workflows/repo-dispatch.yml @@ -0,0 +1,15 @@ +name: Repo-Dispatch-Testing + +on: + repository_dispatch: + types: [my-event] + +jobs: + new-job: + runs-on: ubuntu-latest + steps: + - name: Checking out the code + uses: actions/checkout@v4 + + - name: Checking Which Event + run: echo " The Event is ${{github.event.action}} " From febd9045fabc916c9b2742afb5a7bba43918bf89 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 11:35:06 +0530 Subject: [PATCH 07/40] Create scheduled_jobs.yml --- .github/workflows/scheduled_jobs.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/scheduled_jobs.yml diff --git a/.github/workflows/scheduled_jobs.yml b/.github/workflows/scheduled_jobs.yml new file mode 100644 index 000000000..94d6e2900 --- /dev/null +++ b/.github/workflows/scheduled_jobs.yml @@ -0,0 +1,16 @@ +name: Practise workflow to learn about cron jobs + +on: + schedule: + - cron: "*/5 * * * *" + +jobs: + check_workflow: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + + - name: Printing the date after every 5 minutes + run: echo " The date at which this workflow is running is ${date}" + From 82dd4f1f25df58e5bde3f485b211c081bc653a52 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 12:22:59 +0530 Subject: [PATCH 08/40] Create multi-trigger.yml --- .github/workflows/multi-trigger.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/multi-trigger.yml diff --git a/.github/workflows/multi-trigger.yml b/.github/workflows/multi-trigger.yml new file mode 100644 index 000000000..d1a71fbf8 --- /dev/null +++ b/.github/workflows/multi-trigger.yml @@ -0,0 +1,19 @@ +name: This is a workflow which has multiple triggers + +on: + push: + branches: + - main + - Multi_Trigger_Branch + pull_request: + +jobs: + job_name: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + + - name: Checking a few commands + run: | + echo "The job id is $GITHUB_JOB" From b3637c1e0adb0608309f2f91c239640ab26ea98b Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 12:27:13 +0530 Subject: [PATCH 09/40] Update multi-trigger.yml --- .github/workflows/multi-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/multi-trigger.yml b/.github/workflows/multi-trigger.yml index d1a71fbf8..5009a5d9d 100644 --- a/.github/workflows/multi-trigger.yml +++ b/.github/workflows/multi-trigger.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - Multi_Trigger_Branch + - Multi-Trigger_Branch pull_request: jobs: From f092dc5703bc8d629023dd53d981d4dba31613b0 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 13:03:13 +0530 Subject: [PATCH 10/40] Create manual-worflow.yml --- .github/workflows/manual-worflow.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manual-worflow.yml diff --git a/.github/workflows/manual-worflow.yml b/.github/workflows/manual-worflow.yml new file mode 100644 index 000000000..a829d5425 --- /dev/null +++ b/.github/workflows/manual-worflow.yml @@ -0,0 +1,17 @@ +name: This is to learn the manual dispatch of workflows + +on: + workflow_dispatch: + + +jobs: + manual_dispatch: + runs-on: ubuntu-latest + steps : + - name: Code Checkout + uses: actions/checkout@v4 + + - name: Run Python script + run : python hello.py + + From d6c1ae82d7717b8288c19de668827c642818d8af Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 13:03:53 +0530 Subject: [PATCH 11/40] Create hello.py --- hello.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 hello.py diff --git a/hello.py b/hello.py new file mode 100644 index 000000000..439312d66 --- /dev/null +++ b/hello.py @@ -0,0 +1 @@ +print(hello.py) From d93779d0c54b9fbb6b09a8513eb809949e8c99b4 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 13:05:30 +0530 Subject: [PATCH 12/40] Update hello.py --- hello.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello.py b/hello.py index 439312d66..8cde7829c 100644 --- a/hello.py +++ b/hello.py @@ -1 +1 @@ -print(hello.py) +print("hello world") From cc8863dc2a3dff5f33b67935cfdf7ab49897ca8e Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 14:18:31 +0530 Subject: [PATCH 13/40] Update manual-worflow.yml --- .github/workflows/manual-worflow.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-worflow.yml b/.github/workflows/manual-worflow.yml index a829d5425..aa77981cd 100644 --- a/.github/workflows/manual-worflow.yml +++ b/.github/workflows/manual-worflow.yml @@ -2,6 +2,17 @@ name: This is to learn the manual dispatch of workflows on: workflow_dispatch: + inputs: + script_name: + required: true + description: 'Please choose the name of the .py you want to execute' + default: "hello.py" + type: choice + options: + - "hello.py" + - "hello_1.py" + - "hello_2.py" + - "hello_3.py" jobs: @@ -12,6 +23,6 @@ jobs: uses: actions/checkout@v4 - name: Run Python script - run : python hello.py + run : python ${{github.event.inputs.script_name}} From d7c04ef53b620935769364b0b4ded93f272831fe Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 14:19:00 +0530 Subject: [PATCH 14/40] Create hello_2.py --- hello_2.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 hello_2.py diff --git a/hello_2.py b/hello_2.py new file mode 100644 index 000000000..99226318d --- /dev/null +++ b/hello_2.py @@ -0,0 +1 @@ +print("This is to print hello 2) From 685d5bd2b9f298ffbf4748a954caba4f39bae86e Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 19 Mar 2025 14:27:08 +0530 Subject: [PATCH 15/40] Update hello_2.py --- hello_2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_2.py b/hello_2.py index 99226318d..30df35c91 100644 --- a/hello_2.py +++ b/hello_2.py @@ -1 +1 @@ -print("This is to print hello 2) +print("This is to print hello 2") From 15dbd75e0a6d2b526e2bc0606c2f483106deab03 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 11:07:58 +0530 Subject: [PATCH 16/40] Create repository-dispatch.yml --- .github/workflows/repository-dispatch.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/repository-dispatch.yml diff --git a/.github/workflows/repository-dispatch.yml b/.github/workflows/repository-dispatch.yml new file mode 100644 index 000000000..40a657578 --- /dev/null +++ b/.github/workflows/repository-dispatch.yml @@ -0,0 +1,19 @@ +name: This is to learn how do use repository-dispatch + +on: + repository_dispatch: + types: [webhook] + + +jobs: + running-repodispatch: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: actions/checkout@v4 + + - name: Printing the event name + run: echo "The github event is ${{GITHUB_EVENT_NAME}}" + + + From 04bb26b1392fdeb261cfba20c178c103555c0c0b Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 11:46:39 +0530 Subject: [PATCH 17/40] Update repository-dispatch.yml --- .github/workflows/repository-dispatch.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/repository-dispatch.yml b/.github/workflows/repository-dispatch.yml index 40a657578..0a5decba2 100644 --- a/.github/workflows/repository-dispatch.yml +++ b/.github/workflows/repository-dispatch.yml @@ -1,9 +1,8 @@ -name: This is to learn how do use repository-dispatch +name: This is to learn how to use repository-dispatch on: - repository_dispatch: - types: [webhook] - + repository_dispatch: + types: [webhook] jobs: running-repodispatch: @@ -13,7 +12,14 @@ jobs: uses: actions/checkout@v4 - name: Printing the event name - run: echo "The github event is ${{GITHUB_EVENT_NAME}}" + run: echo "The GitHub event is ${{ github.event_name }}" - - + - name: Trigger repository dispatch + env: + MY_PAT: ${{ secrets.MY_PAT }} + run: | + curl -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token $MY_PAT" \ + https://api.github.com/repos/ammararsiwala/Github-Examples/dispatches \ + -d '{"event_type":"webhook"}' From 9a872b5a80017ba202b311796cd788b4f7b7fed5 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 11:47:49 +0530 Subject: [PATCH 18/40] Update multi-trigger.yml --- .github/workflows/multi-trigger.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/multi-trigger.yml b/.github/workflows/multi-trigger.yml index 5009a5d9d..2df325466 100644 --- a/.github/workflows/multi-trigger.yml +++ b/.github/workflows/multi-trigger.yml @@ -1,11 +1,7 @@ name: This is a workflow which has multiple triggers on: - push: - branches: - - main - - Multi-Trigger_Branch - pull_request: + workflow_dispatch: jobs: job_name: From 8d25c797b7d794f3318798ae79a910385dbc07b9 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 11:57:31 +0530 Subject: [PATCH 19/40] Update repository-dispatch.yml --- .github/workflows/repository-dispatch.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/repository-dispatch.yml b/.github/workflows/repository-dispatch.yml index 0a5decba2..421ec5ac8 100644 --- a/.github/workflows/repository-dispatch.yml +++ b/.github/workflows/repository-dispatch.yml @@ -14,12 +14,4 @@ jobs: - name: Printing the event name run: echo "The GitHub event is ${{ github.event_name }}" - - name: Trigger repository dispatch - env: - MY_PAT: ${{ secrets.MY_PAT }} - run: | - curl -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $MY_PAT" \ - https://api.github.com/repos/ammararsiwala/Github-Examples/dispatches \ - -d '{"event_type":"webhook"}' + From 14eda175c26ba77ca2f55c4a9fc50e57af67b98e Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 12:59:15 +0530 Subject: [PATCH 20/40] Create conditional.yml --- .github/workflows/conditional.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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..51220bd77 --- /dev/null +++ b/.github/workflows/conditional.yml @@ -0,0 +1,28 @@ +name: This is to learn about conditional workflows + +on: [push] + + +jobs: + first_job: + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: acions/checkout@v4 + + - name: Print a constant message + run: echo "Hello this message will be printed irrespective of the message" + + second_job: + if: github.repository == "Github Examples" + runs-on: ubuntu-latest + steps: + - name: Code Checkout + uses: acions/checkout@v4 + + - name: Print a variable message + run: echo "Hello this message will be printed only if the repo name is correct" + + + + From 8ae4614de5737511472cae0103010ee745c73c7a Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 13:00:41 +0530 Subject: [PATCH 21/40] Update conditional.yml --- .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 51220bd77..b591ff194 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -14,7 +14,7 @@ jobs: run: echo "Hello this message will be printed irrespective of the message" second_job: - if: github.repository == "Github Examples" + if: github.repository == "Github-Examples" runs-on: ubuntu-latest steps: - name: Code Checkout From f7cde07d68ceb0d55da773d92711fc6024feb91c Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 13:03:08 +0530 Subject: [PATCH 22/40] Update conditional.yml --- .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 b591ff194..d74408bd0 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -14,7 +14,7 @@ jobs: run: echo "Hello this message will be printed irrespective of the message" second_job: - if: github.repository == "Github-Examples" + if: github.repository == 'ammararsiwala/Github-Examples' runs-on: ubuntu-latest steps: - name: Code Checkout From 5a10f69b141ae5ef70889697f13e13ec2e90c4dc Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 13:05:23 +0530 Subject: [PATCH 23/40] Update conditional.yml --- .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 d74408bd0..6e856d66a 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Code Checkout - uses: acions/checkout@v4 + uses: actions/checkout@v4 - name: Print a variable message run: echo "Hello this message will be printed only if the repo name is correct" From 4dc356933b3ff606a0e83dfb971e551804e7f9bb Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Mon, 24 Mar 2025 13:06:01 +0530 Subject: [PATCH 24/40] Update conditional.yml --- .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 6e856d66a..dd3b42232 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Code Checkout - uses: acions/checkout@v4 + uses: actions/checkout@v4 - name: Print a constant message run: echo "Hello this message will be printed irrespective of the message" From ef7c9b5d327cdb536d240388e21b6b942a1d17bc Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 10:48:20 +0530 Subject: [PATCH 25/40] Create functions.yml --- .github/workflows/functions.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/functions.yml diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml new file mode 100644 index 000000000..29f39a40d --- /dev/null +++ b/.github/workflows/functions.yml @@ -0,0 +1,12 @@ +name: This workflow is basically used to learn different types of functions + +on: + push + +jobs: + function-checkers: + runs-on: ubuntu-latest + steps: + - name: Check is string contains sub-strings + if: contains("Ammar",:mm") + From e9fbaa27e4fc7481614855a79bf80c8ea70c759d Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 10:49:52 +0530 Subject: [PATCH 26/40] Update functions.yml --- .github/workflows/functions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 29f39a40d..e3e5dd76e 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -9,4 +9,5 @@ jobs: steps: - name: Check is string contains sub-strings if: contains("Ammar",:mm") + run: echo "Substring present" From 9d8e2a541432466dd55f1da3a4386c6b73e900b7 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 10:50:13 +0530 Subject: [PATCH 27/40] Update functions.yml --- .github/workflows/functions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index e3e5dd76e..d2be21b52 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -8,6 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Check is string contains sub-strings - if: contains("Ammar",:mm") + if: contains("Ammar","mm") run: echo "Substring present" From ea0fe8cfbf3f34a30156c230d229444fd1be31a7 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:07:33 +0530 Subject: [PATCH 28/40] Update functions.yml --- .github/workflows/functions.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index d2be21b52..c2fa54a03 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -3,11 +3,18 @@ name: This workflow is basically used to learn different types of functions on: push +env: + STR: "Ammar" + SUBSTRING: "mm" + jobs: function-checkers: runs-on: ubuntu-latest steps: - name: Check is string contains sub-strings - if: contains("Ammar","mm") + env: + l1 : ${{env.STR}} + l2 : ${{env.SUBSTRING}} + if: contains(env.l1,env.l2) run: echo "Substring present" From 8c78c4c2e63121f8ce60fac914ad95926c054207 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:08:50 +0530 Subject: [PATCH 29/40] Update functions.yml --- .github/workflows/functions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index c2fa54a03..fd6d6fa84 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -5,7 +5,7 @@ on: env: STR: "Ammar" - SUBSTRING: "mm" + SUBSTRING: "mmmmmmmmm" jobs: function-checkers: From 7df8098576cd0013f12636e3aa2d2d20b1687b06 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:10:02 +0530 Subject: [PATCH 30/40] Update conditional.yml --- .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 dd3b42232..64e922b5f 100644 --- a/.github/workflows/conditional.yml +++ b/.github/workflows/conditional.yml @@ -1,6 +1,6 @@ name: This is to learn about conditional workflows -on: [push] +on: pull_request jobs: From 2029b60ac24e893a6746f26488a221070a525abf Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:16:18 +0530 Subject: [PATCH 31/40] Update functions.yml --- .github/workflows/functions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index fd6d6fa84..90c3a5b05 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -17,4 +17,7 @@ jobs: l2 : ${{env.SUBSTRING}} if: contains(env.l1,env.l2) run: echo "Substring present" + - name: Substring Not Present + if: (!contains(env.l1,env.l2)) + run: echo "Not Present" From e792d4403f0a92919ecd84468e539c3e82ea719a Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:18:41 +0530 Subject: [PATCH 32/40] Update functions.yml --- .github/workflows/functions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 90c3a5b05..da684ab7a 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -18,6 +18,6 @@ jobs: if: contains(env.l1,env.l2) run: echo "Substring present" - name: Substring Not Present - if: (!contains(env.l1,env.l2)) + if: ${{ (!contains(env.l1,env.l2)) }} run: echo "Not Present" From d6b812fd00c78e7549a2a03bd9ca93370f879b75 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:20:27 +0530 Subject: [PATCH 33/40] Update functions.yml --- .github/workflows/functions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index da684ab7a..01ef0668f 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -18,6 +18,6 @@ jobs: if: contains(env.l1,env.l2) run: echo "Substring present" - name: Substring Not Present - if: ${{ (!contains(env.l1,env.l2)) }} + if: ${{ !contains(env.l1,env.l2) }} run: echo "Not Present" From 12ab2eff69bbb6198bfede4e5260ae7de1c91793 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 11:28:32 +0530 Subject: [PATCH 34/40] Update functions.yml --- .github/workflows/functions.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 01ef0668f..3d9eeda99 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -8,16 +8,16 @@ env: SUBSTRING: "mmmmmmmmm" jobs: - function-checkers: - runs-on: ubuntu-latest - steps: - - name: Check is string contains sub-strings - env: - l1 : ${{env.STR}} - l2 : ${{env.SUBSTRING}} - if: contains(env.l1,env.l2) - run: echo "Substring present" - - name: Substring Not Present - if: ${{ !contains(env.l1,env.l2) }} - run: echo "Not Present" - + function-checkers: + runs-on: ubuntu-latest + steps: + - name: Check if string contains sub-strings + env: + l1: ${{ env.STR }} + l2: ${{ env.SUBSTRING }} + if: contains(env.l1, env.l2) + run: echo "Substring present" + + - name: Substring Not Present + if: ${{ !contains(env.l1, env.l2) }} + run: echo "Not Present" From e5207559647f6e403eac3d6f35283d3d48ca59fd Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 15:55:03 +0530 Subject: [PATCH 35/40] Create commands.yml --- .github/workflows/commands.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/commands.yml diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml new file mode 100644 index 000000000..c3ac7653c --- /dev/null +++ b/.github/workflows/commands.yml @@ -0,0 +1,16 @@ +name: To run diff commands in git actions + +on: + workflow_dispatch + +jobs: + new-job: + runs-on: ubuntu-latest + steps: + - name: Grouping + run: | + echo "::grouping:: Grouped Messages" + echo "msg1" + echo "msg2" + echo "msg3" + echo "::endgroup::" From cf40a87b454b5133f0903acbc8f63ccbc481507d Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 16:00:12 +0530 Subject: [PATCH 36/40] Update scheduled_jobs.yml --- .github/workflows/scheduled_jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled_jobs.yml b/.github/workflows/scheduled_jobs.yml index 94d6e2900..c7d5f2639 100644 --- a/.github/workflows/scheduled_jobs.yml +++ b/.github/workflows/scheduled_jobs.yml @@ -2,7 +2,7 @@ name: Practise workflow to learn about cron jobs on: schedule: - - cron: "*/5 * * * *" + - cron: "*0 0 1 1 *" jobs: check_workflow: From 89c880090130d3e977e05db7be3102852adc59f3 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 1 Apr 2025 16:10:19 +0530 Subject: [PATCH 37/40] Update commands.yml --- .github/workflows/commands.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index c3ac7653c..ed7e965fe 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -14,3 +14,10 @@ jobs: echo "msg2" echo "msg3" echo "::endgroup::" + + - name: Step 1 + run: | + echo "MY_PAT = hello" > $GITHUB_ENV + - name: Step 2 + run: | + echo $MY_PAT From a8bab10b80ce93fc0c5a3a8b452b72c789ff4fab Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 2 Apr 2025 11:34:07 +0530 Subject: [PATCH 38/40] Create dependent-jobs.yml --- .github/workflows/dependent-jobs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/dependent-jobs.yml diff --git a/.github/workflows/dependent-jobs.yml b/.github/workflows/dependent-jobs.yml new file mode 100644 index 000000000..476cc5781 --- /dev/null +++ b/.github/workflows/dependent-jobs.yml @@ -0,0 +1,18 @@ +name: Workflow to learn about dependent jobs + +on: + push + +jobs: + job1: + runs-on: windows + steps: + - run: | + echo "World" + + job2: + runs-on: ubuntu-latest + needs: job1 + steps: + - run: | + echo "Hello" From 0793eabf48eea6b18fceeda3baaa4ed9299fe17c Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 2 Apr 2025 11:38:49 +0530 Subject: [PATCH 39/40] Update dependent-jobs.yml --- .github/workflows/dependent-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependent-jobs.yml b/.github/workflows/dependent-jobs.yml index 476cc5781..48cc07c7c 100644 --- a/.github/workflows/dependent-jobs.yml +++ b/.github/workflows/dependent-jobs.yml @@ -5,7 +5,7 @@ on: jobs: job1: - runs-on: windows + runs-on: windows-latest steps: - run: | echo "World" From 111dc6bffc847b0ac3e3329696e7982c0b3163e5 Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Wed, 2 Apr 2025 12:51:27 +0530 Subject: [PATCH 40/40] Create setting-environment-variables.yml --- .../setting-environment-variables.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/setting-environment-variables.yml diff --git a/.github/workflows/setting-environment-variables.yml b/.github/workflows/setting-environment-variables.yml new file mode 100644 index 000000000..a168527a0 --- /dev/null +++ b/.github/workflows/setting-environment-variables.yml @@ -0,0 +1,18 @@ +name: This is a workflow to test env variables + +on: + workflow_dispatch + +jobs: + test: + runs-on: ubuntu-latest + steps: + + - name: Trying to add a value + run: | + echo "MY_NEW=hello" >> $GITHUB_ENV + + - name: Printing that value + run: | + echo "the value stored in the file is $MY_NEW" +