From e8fb9525cf23a86b6f43eb5aed2f96dc0201ad32 Mon Sep 17 00:00:00 2001 From: tirthraj130301 <105789910+tirthraj130301@users.noreply.github.com> Date: Thu, 26 May 2022 10:57:10 +0530 Subject: [PATCH 1/3] Create Handson6.yml --- .github/workflows/Handson6.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/Handson6.yml diff --git a/.github/workflows/Handson6.yml b/.github/workflows/Handson6.yml new file mode 100644 index 0000000..daa8a4e --- /dev/null +++ b/.github/workflows/Handson6.yml @@ -0,0 +1,20 @@ +name: conditional workflow +on: push, + pull_request: + branches: + - 'main' + +jobs: + normal_job: + runs-on: ubuntu-latest + steps: + - name: Print Step in normal job + run: ./run-tests + + pull_request_job: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: Print Step in PR job + run: | + echo "Hello From pull_request_job" From 5f972c5d999c4bd3f5e5b6341d3f57dabe301ac5 Mon Sep 17 00:00:00 2001 From: tirthraj130301 <105789910+tirthraj130301@users.noreply.github.com> Date: Thu, 26 May 2022 11:05:19 +0530 Subject: [PATCH 2/3] Update Handson6.yml --- .github/workflows/Handson6.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Handson6.yml b/.github/workflows/Handson6.yml index daa8a4e..531012b 100644 --- a/.github/workflows/Handson6.yml +++ b/.github/workflows/Handson6.yml @@ -1,8 +1,9 @@ name: conditional workflow -on: push, +on: pull_request: branches: - 'main' + push: jobs: normal_job: From 6b1294d3aab27724f0e507775a7c97f8e9606ef4 Mon Sep 17 00:00:00 2001 From: tirthraj130301 <105789910+tirthraj130301@users.noreply.github.com> Date: Thu, 26 May 2022 11:07:14 +0530 Subject: [PATCH 3/3] Update Handson6.yml --- .github/workflows/Handson6.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Handson6.yml b/.github/workflows/Handson6.yml index 531012b..1f85026 100644 --- a/.github/workflows/Handson6.yml +++ b/.github/workflows/Handson6.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Print Step in normal job - run: ./run-tests + run: | + echo "Hello From normal_job" pull_request_job: runs-on: ubuntu-latest