From 172f6d8541407e148c1f6974be298f34dd5738d9 Mon Sep 17 00:00:00 2001 From: Muhammad Zayan Date: Tue, 5 May 2026 18:52:09 +0500 Subject: [PATCH 1/2] deleted all workflows except 6th --- .github/workflows/fifthworkflow.yml | 20 ------------------- .github/workflows/firstworkflow.yml | 13 ------------- .github/workflows/fourthworkflow.yml | 28 --------------------------- .github/workflows/second-workflow.yml | 18 ----------------- .github/workflows/thirdworkflow.yml | 20 ------------------- test.txt | 1 + 6 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 .github/workflows/fifthworkflow.yml delete mode 100644 .github/workflows/firstworkflow.yml delete mode 100644 .github/workflows/fourthworkflow.yml delete mode 100644 .github/workflows/second-workflow.yml delete mode 100644 .github/workflows/thirdworkflow.yml create mode 100644 test.txt diff --git a/.github/workflows/fifthworkflow.yml b/.github/workflows/fifthworkflow.yml deleted file mode 100644 index e927658..0000000 --- a/.github/workflows/fifthworkflow.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Fifth workflow (Conditions) - -on: - workflow_dispatch - -jobs: - condition-job: - runs-on: ubuntu-latest - - steps: - - name: Step 1 - Run something - run: echo "Running main task..." - - - name: Step 3 - Runs only if success - if: success() - run: echo "Everything passed!" - - - name: Step 4 - Runs only if failure - if: failure() - run: echo "Something failed!" diff --git a/.github/workflows/firstworkflow.yml b/.github/workflows/firstworkflow.yml deleted file mode 100644 index de7add1..0000000 --- a/.github/workflows/firstworkflow.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: First workflow for the DevOps students fall2026 - -on: - workflow_dispatch - -jobs: - first-job: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: cat firstfile.txt -... diff --git a/.github/workflows/fourthworkflow.yml b/.github/workflows/fourthworkflow.yml deleted file mode 100644 index 5637356..0000000 --- a/.github/workflows/fourthworkflow.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Fourth workflow (Job Status) - -on: - workflow_dispatch - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Build step - run: echo "Building project..." - - test: - runs-on: ubuntu-latest - needs: build # 👈 runs only after build - - steps: - - name: Test step - run: echo "Running tests..." - - deploy: - runs-on: ubuntu-latest - needs: test # 👈 runs only after test - - steps: - - name: Deploy step - run: echo "Deploying project..." diff --git a/.github/workflows/second-workflow.yml b/.github/workflows/second-workflow.yml deleted file mode 100644 index 08b3f4a..0000000 --- a/.github/workflows/second-workflow.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Second workflow - -on: - workflow_dispatch - -jobs: - second-job: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Show text file - run: cat secondfile.txt - - - name: Run python file - run: python3 secondfile.py diff --git a/.github/workflows/thirdworkflow.yml b/.github/workflows/thirdworkflow.yml deleted file mode 100644 index 8481f58..0000000 --- a/.github/workflows/thirdworkflow.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Third workflow (Filtered Branch) - -on: - push: - branches: - - main - -jobs: - third-job: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Show message - run: echo "This runs only on main branch" - - - name: Show files - run: ls diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..b40797f --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +hello there From 3f3b013ea16bb976ff2d572133c84e1b961de9d7 Mon Sep 17 00:00:00 2001 From: Muhammad Zayan Date: Tue, 5 May 2026 19:01:35 +0500 Subject: [PATCH 2/2] changed sixth workflow --- .../workflows/sixth-workflow-pull-request.yml | 43 +++++++++++++++++++ .github/workflows/sixthworkflow.yml | 20 --------- 2 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/sixth-workflow-pull-request.yml delete mode 100644 .github/workflows/sixthworkflow.yml diff --git a/.github/workflows/sixth-workflow-pull-request.yml b/.github/workflows/sixth-workflow-pull-request.yml new file mode 100644 index 0000000..59d00f8 --- /dev/null +++ b/.github/workflows/sixth-workflow-pull-request.yml @@ -0,0 +1,43 @@ +name: Sixth Workflow Using GitHub Actions + +run-name: >+ + Sixth workflow + ${{ github.actor }} has triggered this workflow + using ${{ github.event_name }} event + on branch ${{ github.ref }} of ${{github.repository}} repo. +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + first-job: + runs-on: ubuntu-latest + steps: + - name: Checking out to the repository + uses: actions/checkout@v4 + - name: List all the files in the repo branch + run: ls -la + - name: Printing the contents of a file + run: cat firstfile.txt + second-job: + runs-on: ubuntu-latest + needs: first-job + if: always() + steps: + - name: Send notification about the cicd status + if: always() + uses: dawidd6/action-send-mail@v6 + with: + server_address: ${{secrets.SMTP_HOST}} + server_port: 587 + secure: false + username: ${{secrets.SMTP_USERNAME}} + password: ${{secrets.SMTP_PASSWORD}} + subject: Github Actions job result + to: ${{vars.MAIL_TO_LIST}} + from: sajidali - GitHub Action + body: >+ + Build job of ${{github.repository}} completed with result status of ${{needs.first-job.result}} + "Find more details on: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/.github/workflows/sixthworkflow.yml b/.github/workflows/sixthworkflow.yml deleted file mode 100644 index e5a42c3..0000000 --- a/.github/workflows/sixthworkflow.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Sixth workflow (Pull Request) - -on: - pull_request: - branches: - - main - -jobs: - pr-job: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: PR message - run: echo "Pull Request workflow is running!" - - - name: Show files - run: ls