From e6469f31beaefddcd8987f5d95e62da841e98ebc Mon Sep 17 00:00:00 2001 From: ammararsiwala Date: Tue, 18 Mar 2025 11:50:24 +0530 Subject: [PATCH 01/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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/24] 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"