From ba38924f16253ab904019e995c76d9beab78a61d Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Wed, 15 Apr 2026 23:05:00 +0530 Subject: [PATCH 01/19] initial commit / devbox & virtual env setup --- .devbox/virtenv/bin/initHook.sh | 1 + .devbox/virtenv/bin/venvShellHook.sh | 1 + .devbox/virtenv/poetry/bin/initHook.sh | 3 + .../virtenv/python312/bin/venvShellHook.sh | 55 +++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 120000 .devbox/virtenv/bin/initHook.sh create mode 120000 .devbox/virtenv/bin/venvShellHook.sh create mode 100755 .devbox/virtenv/poetry/bin/initHook.sh create mode 100755 .devbox/virtenv/python312/bin/venvShellHook.sh diff --git a/.devbox/virtenv/bin/initHook.sh b/.devbox/virtenv/bin/initHook.sh new file mode 120000 index 00000000..5ee70171 --- /dev/null +++ b/.devbox/virtenv/bin/initHook.sh @@ -0,0 +1 @@ +/home/deepak/Projects/devops-directive-github-actions-course/.devbox/virtenv/poetry/bin/initHook.sh \ No newline at end of file diff --git a/.devbox/virtenv/bin/venvShellHook.sh b/.devbox/virtenv/bin/venvShellHook.sh new file mode 120000 index 00000000..d0a8fdaf --- /dev/null +++ b/.devbox/virtenv/bin/venvShellHook.sh @@ -0,0 +1 @@ +/home/deepak/Projects/devops-directive-github-actions-course/.devbox/virtenv/python312/bin/venvShellHook.sh \ No newline at end of file diff --git a/.devbox/virtenv/poetry/bin/initHook.sh b/.devbox/virtenv/poetry/bin/initHook.sh new file mode 100755 index 00000000..e4a5a0ea --- /dev/null +++ b/.devbox/virtenv/poetry/bin/initHook.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +poetry env use $(command -v python) --directory="${DEVBOX_PYPROJECT_DIR:-$DEVBOX_DEFAULT_PYPROJECT_DIR}" --no-interaction --quiet >&2 diff --git a/.devbox/virtenv/python312/bin/venvShellHook.sh b/.devbox/virtenv/python312/bin/venvShellHook.sh new file mode 100755 index 00000000..84c5ab10 --- /dev/null +++ b/.devbox/virtenv/python312/bin/venvShellHook.sh @@ -0,0 +1,55 @@ +#!/bin/sh +set -eu +STATE_FILE="$DEVBOX_PROJECT_ROOT/.devbox/venv_check_completed" + +is_valid_venv() { + [ -f "$1/bin/activate" ] && [ -f "$1/bin/python" ] +} + +is_devbox_venv() { + [ "$1/bin/python" -ef "$DEVBOX_PACKAGES_DIR/bin/python" ] +} + +create_venv() { + python -m venv "$VENV_DIR" --clear + echo "*\n.*" >> "$VENV_DIR/.gitignore" +} + +# Check that Python version supports venv +if ! python -c 'import venv' 1> /dev/null 2> /dev/null; then + echo "WARNING: Python version must be > 3.3 to create a virtual environment." + touch "$STATE_FILE" + exit 1 +fi + +# Check if the directory exists +if [ -d "$VENV_DIR" ]; then + if is_valid_venv "$VENV_DIR"; then + # Check if we've already run this script + if [ -f "$STATE_FILE" ]; then + # "We've already run this script. Exiting..." + exit 0 + fi + if ! is_devbox_venv "$VENV_DIR"; then + echo "WARNING: Virtual environment at $VENV_DIR doesn't use Devbox Python." + echo "Do you want to overwrite it? (y/n)" + read reply + echo + case "$reply" in + [Yy]) echo "Overwriting existing virtual environment..." + create_venv ;; + [Nn]) echo "Using your existing virtual environment. We recommend changing \$VENV_DIR to a different location" + touch "$STATE_FILE" + exit 0 ;; + *) echo "Invalid input. Exiting..." + exit 1 ;; + esac + fi + else + echo "Directory exists but is not a valid virtual environment. Creating a new one..." + create_venv + fi +else + echo "Virtual environment directory doesn't exist. Creating new one..." + create_venv +fi From ecbbcabbfdec8a23b56c357dc35aa0be6fd066d5 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 11:46:36 +0530 Subject: [PATCH 02/19] expereimented / messin around with yaml file --- .github/workflows/03-core-features--01-hello-world.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/03-core-features--01-hello-world.yaml b/.github/workflows/03-core-features--01-hello-world.yaml index b358d3af..1c3714bd 100644 --- a/.github/workflows/03-core-features--01-hello-world.yaml +++ b/.github/workflows/03-core-features--01-hello-world.yaml @@ -1,7 +1,9 @@ name: Hello World on: - workflow_dispatch: + push: + branches: + - main jobs: say-hello-inline-bash: From 6a97ee2529f4bb8fc01d52f370b00225a6b551b5 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 11:48:23 +0530 Subject: [PATCH 03/19] Hello World --- .github/workflows/03-core-features--01-hello-world.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/03-core-features--01-hello-world.yaml b/.github/workflows/03-core-features--01-hello-world.yaml index 1c3714bd..b358d3af 100644 --- a/.github/workflows/03-core-features--01-hello-world.yaml +++ b/.github/workflows/03-core-features--01-hello-world.yaml @@ -1,9 +1,7 @@ name: Hello World on: - push: - branches: - - main + workflow_dispatch: jobs: say-hello-inline-bash: From 60bd17b62417b915398990ed2037005e55260df1 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 11:53:58 +0530 Subject: [PATCH 04/19] Step Types - By Deepak --- .github/workflows/03-core-features--02-step-types.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/workflows/03-core-features--02-step-types.yaml index 8abea6b1..0b087a53 100644 --- a/.github/workflows/03-core-features--02-step-types.yaml +++ b/.github/workflows/03-core-features--02-step-types.yaml @@ -7,12 +7,12 @@ jobs: say-hello-inline-bash: runs-on: ubuntu-24.04 steps: - - run: echo "Hello from an inline bash script in a GitHub Action Workflow!" + - run: echo "Hello from an inline bash script in a GitHub Action Workflow! By Deepak" say-hello-inline-python: runs-on: ubuntu-24.04 steps: - - run: print("Hello from an inline python script in a GitHub Action Workflow!") + - run: print("Hello from an inline python script in a GitHub Action Workflow! By Deepak") shell: python say-hello-action: @@ -21,4 +21,4 @@ jobs: - uses: actions/hello-world-javascript-action@081a6d193d1dcb38460df1e6927486d748730f9d # v1.1 # - uses: actions/hello-world-javascript-action@v1 # This would work, but it would be less stable and less secure: with: - who-to-greet: "from an action in the GitHub Action marketplace! 👋" + who-to-greet: "from an action in the GitHub Action marketplace! 👋 By Marian" From 33a923ce16820acd6aa68ed0f4c3d9981cce2482 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 11:57:18 +0530 Subject: [PATCH 05/19] Step Types - By Deepak (name change) --- .github/workflows/03-core-features--02-step-types.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/workflows/03-core-features--02-step-types.yaml index 0b087a53..87210754 100644 --- a/.github/workflows/03-core-features--02-step-types.yaml +++ b/.github/workflows/03-core-features--02-step-types.yaml @@ -1,4 +1,4 @@ -name: Step Types +name: Step Types - By Deepak on: workflow_dispatch: From a9c2cca9bcac9f409e3c8addba3fb92149789aad Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 12:06:57 +0530 Subject: [PATCH 06/19] Step Types - parallel process --- .github/workflows/03-core-features--02-step-types.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/workflows/03-core-features--02-step-types.yaml index 87210754..0b087a53 100644 --- a/.github/workflows/03-core-features--02-step-types.yaml +++ b/.github/workflows/03-core-features--02-step-types.yaml @@ -1,4 +1,4 @@ -name: Step Types - By Deepak +name: Step Types on: workflow_dispatch: From 7e85f9840c5d871de4a1412d383ab5096a43b0ad Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 12:12:27 +0530 Subject: [PATCH 07/19] Step Types - sequencial process --- .../03-core-features--02-step-types.yaml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/workflows/03-core-features--02-step-types.yaml index 0b087a53..309750d5 100644 --- a/.github/workflows/03-core-features--02-step-types.yaml +++ b/.github/workflows/03-core-features--02-step-types.yaml @@ -4,21 +4,16 @@ on: workflow_dispatch: jobs: - say-hello-inline-bash: + say-hello-combined-step: runs-on: ubuntu-24.04 steps: - - run: echo "Hello from an inline bash script in a GitHub Action Workflow! By Deepak" - - say-hello-inline-python: - runs-on: ubuntu-24.04 - steps: - - run: print("Hello from an inline python script in a GitHub Action Workflow! By Deepak") + - name: Say Hello from an Inline Bash Script Step + run: echo "Hello from an inline bash script in a GitHub Action Workflow!" + - name: Say Hello from Python Step shell: python + run: print("Hello from an inline python script in a GitHub Action Workflow!") - say-hello-action: - runs-on: ubuntu-24.04 - steps: - - uses: actions/hello-world-javascript-action@081a6d193d1dcb38460df1e6927486d748730f9d # v1.1 - # - uses: actions/hello-world-javascript-action@v1 # This would work, but it would be less stable and less secure: + - name: Say Hello from a JavaScript Marketplace Action Step + uses: actions/hello-world-javascript-action@081a6d193d1dcb38460df1e6927486d748730f9d with: - who-to-greet: "from an action in the GitHub Action marketplace! 👋 By Marian" + who-to-greet: "from anaction in a GitHub Action marketplace! 👋 By Marian" \ No newline at end of file From b6629301db726cc29c462d5903f3bc2cafd8955b Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 12:16:57 +0530 Subject: [PATCH 08/19] Step Types - parallel process - default - By Deepak --- .../03-core-features--02-step-types.yaml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/workflows/03-core-features--02-step-types.yaml index 309750d5..3fc70b46 100644 --- a/.github/workflows/03-core-features--02-step-types.yaml +++ b/.github/workflows/03-core-features--02-step-types.yaml @@ -4,16 +4,21 @@ on: workflow_dispatch: jobs: - say-hello-combined-step: + say-hello-inline-bash: runs-on: ubuntu-24.04 steps: - - name: Say Hello from an Inline Bash Script Step - run: echo "Hello from an inline bash script in a GitHub Action Workflow!" - - name: Say Hello from Python Step + - run: echo "Hello from an inline bash script in a GitHub Action Workflow! By Deepak" + + say-hello-inline-python: + runs-on: ubuntu-24.04 + steps: + - run: print("Hello from an inline python script in a GitHub Action Workflow! By Deepak") shell: python - run: print("Hello from an inline python script in a GitHub Action Workflow!") - - name: Say Hello from a JavaScript Marketplace Action Step - uses: actions/hello-world-javascript-action@081a6d193d1dcb38460df1e6927486d748730f9d + say-hello-action: + runs-on: ubuntu-24.04 + steps: + - uses: actions/hello-world-javascript-action@081a6d193d1dcb38460df1e6927486d748730f9d # v1.1 + # - uses: actions/hello-world-javascript-action@v1 # This would work, but it would be less stable and less secure: with: - who-to-greet: "from anaction in a GitHub Action marketplace! 👋 By Marian" \ No newline at end of file + who-to-greet: "from an action in the GitHub Action marketplace! 👋 By Marian" \ No newline at end of file From b3f3ca47f6d140255f9098413a1cffa8085ddf0a Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 13:03:51 +0530 Subject: [PATCH 09/19] Own workflow design to undertand the operations better --- ...03-core-features--03-workflows-jobs-steps.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml index cbb562c0..c693cdbf 100644 --- a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml +++ b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml @@ -10,6 +10,7 @@ jobs: - run: echo "one or more steps" - run: echo "which run sequentially" - run: echo "within the same compute environment" + - run: "And now I am adding a few lines of my own here to know and get familiarized with the operations" job-2: runs-on: ubuntu-24.04 steps: @@ -19,6 +20,7 @@ jobs: needs: - job-1 - job-2 + - job-5 # a new job to explore the realtion and working of the jobs in a workflow steps: - run: echo "They can also depend on one another..." job-4: @@ -28,3 +30,16 @@ jobs: - job-3 steps: - run: echo "...to form a directed acyclic graph (DAG)" + +# By Deepak + job-5: + runs-on: ubuntu-24.04 + steps: + - run: echo "This is a new job that I have added to this workflow which is independent of the other jobs and can run in parallel with them." + - run: echo "This is a second step in the new job of this workflow" + +# By Deepak + job-6: + runs-on: ubuntu-24.04 + steps: + - run: echo "This job is independent of all and runs in parallel with all the other jobs in this workflow" \ No newline at end of file From d5890cc92cb1bf0547f44affada0e54d4adbaf5f Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 13:10:43 +0530 Subject: [PATCH 10/19] Syntax error fix in new worklow / edit --- .../workflows/03-core-features--03-workflows-jobs-steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml index c693cdbf..a7288890 100644 --- a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml +++ b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml @@ -10,7 +10,7 @@ jobs: - run: echo "one or more steps" - run: echo "which run sequentially" - run: echo "within the same compute environment" - - run: "And now I am adding a few lines of my own here to know and get familiarized with the operations" + - run: echo "And now I am adding a few lines of my own here to know and get familiarized with the operations" job-2: runs-on: ubuntu-24.04 steps: From 86b4fb15916af93aaefe82dccf275cbbfb7076d0 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 13:19:24 +0530 Subject: [PATCH 11/19] Another update to the Workflows, Jobs and Steps Action --- .../workflows/03-core-features--03-workflows-jobs-steps.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml index a7288890..c4cc02da 100644 --- a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml +++ b/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml @@ -5,6 +5,8 @@ on: jobs: job-1: runs-on: ubuntu-24.04 + needs: + - job-5 # a new job to explore the realtion and working of the jobs in a workflow steps: - run: echo "A job consists of" - run: echo "one or more steps" From 1ddaf9a1ce2fccc3963defd864cdb3f946de81fa Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 13:56:06 +0530 Subject: [PATCH 12/19] Reslove potential error --- .../workflows/03-core-features--04-triggers-and-filters.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/03-core-features--04-triggers-and-filters.yaml b/.github/workflows/03-core-features--04-triggers-and-filters.yaml index d5d72d3b..4958f0f4 100644 --- a/.github/workflows/03-core-features--04-triggers-and-filters.yaml +++ b/.github/workflows/03-core-features--04-triggers-and-filters.yaml @@ -23,8 +23,8 @@ on: - "!03-core-features/filters/*.txt" ### https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule - # schedule: - # - cron: "0 0 * * *" # Midnight UTC + schedule: + - cron: "0 0 * * *" # Midnight UTC ## Manual Trigger workflow_dispatch: From a2c1890cbd4ad04b790592a8513a8f6e00fecabb Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 14:00:46 +0530 Subject: [PATCH 13/19] Another .txt file to ignore the trigger --- 03-core-features/filters/another-exclude-file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 03-core-features/filters/another-exclude-file.txt diff --git a/03-core-features/filters/another-exclude-file.txt b/03-core-features/filters/another-exclude-file.txt new file mode 100644 index 00000000..e69de29b From 2a50aebeab2262ebdcefd7f249e62919c6b4e450 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Thu, 16 Apr 2026 14:01:55 +0530 Subject: [PATCH 14/19] Another .md file to trigger the workflow --- 03-core-features/filters/another-include-file.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 03-core-features/filters/another-include-file.md diff --git a/03-core-features/filters/another-include-file.md b/03-core-features/filters/another-include-file.md new file mode 100644 index 00000000..e69de29b From 5d6c41a4a5dc66b811a794d43c72d7d0ef5e6019 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Fri, 17 Apr 2026 08:50:05 +0530 Subject: [PATCH 15/19] witnssed the corn/timed operation and then turned it into a comment --- .../workflows/03-core-features--04-triggers-and-filters.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/03-core-features--04-triggers-and-filters.yaml b/.github/workflows/03-core-features--04-triggers-and-filters.yaml index 4958f0f4..8afa2ed3 100644 --- a/.github/workflows/03-core-features--04-triggers-and-filters.yaml +++ b/.github/workflows/03-core-features--04-triggers-and-filters.yaml @@ -23,8 +23,8 @@ on: - "!03-core-features/filters/*.txt" ### https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule - schedule: - - cron: "0 0 * * *" # Midnight UTC + # schedule: + # - cron: "0 0 * * *" # Midnight UTC ## Manual Trigger workflow_dispatch: From 8369452db245ce96c2e8a9142ec14484837e4393 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Fri, 17 Apr 2026 09:02:00 +0530 Subject: [PATCH 16/19] A trigger for merge - .md file --- 03-core-features/filters/READEME.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 03-core-features/filters/READEME.md diff --git a/03-core-features/filters/READEME.md b/03-core-features/filters/READEME.md new file mode 100644 index 00000000..e69de29b From c70c5bcb6ba0d82fbf0d6cd5540dda0c805bc036 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Fri, 17 Apr 2026 09:10:22 +0530 Subject: [PATCH 17/19] Paths trigger clean up --- 03-core-features/filters/READEME.md | 0 03-core-features/filters/another-exclude-file.txt | 0 03-core-features/filters/another-include-file.md | 0 03-core-features/filters/excluded-file.txt | 0 03-core-features/filters/included-file.md | 0 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 03-core-features/filters/READEME.md delete mode 100644 03-core-features/filters/another-exclude-file.txt delete mode 100644 03-core-features/filters/another-include-file.md delete mode 100644 03-core-features/filters/excluded-file.txt delete mode 100644 03-core-features/filters/included-file.md diff --git a/03-core-features/filters/READEME.md b/03-core-features/filters/READEME.md deleted file mode 100644 index e69de29b..00000000 diff --git a/03-core-features/filters/another-exclude-file.txt b/03-core-features/filters/another-exclude-file.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/03-core-features/filters/another-include-file.md b/03-core-features/filters/another-include-file.md deleted file mode 100644 index e69de29b..00000000 diff --git a/03-core-features/filters/excluded-file.txt b/03-core-features/filters/excluded-file.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/03-core-features/filters/included-file.md b/03-core-features/filters/included-file.md deleted file mode 100644 index e69de29b..00000000 From f595e099cf4b61c499bb644a839b29d1f5eb7e79 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Fri, 17 Apr 2026 09:14:58 +0530 Subject: [PATCH 18/19] A included file to check with the pull request --- 03-core-features/filters/included-file.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 03-core-features/filters/included-file.md diff --git a/03-core-features/filters/included-file.md b/03-core-features/filters/included-file.md new file mode 100644 index 00000000..e69de29b From 81cc5928eeba7b38e9d437822d9bbc3eb1e0e390 Mon Sep 17 00:00:00 2001 From: k-marian-deepak Date: Fri, 17 Apr 2026 09:22:31 +0530 Subject: [PATCH 19/19] A excluded file to check with the pull request --- 03-core-features/filters/excluded-file.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 03-core-features/filters/excluded-file.txt diff --git a/03-core-features/filters/excluded-file.txt b/03-core-features/filters/excluded-file.txt new file mode 100644 index 00000000..e69de29b