From dfeb5c6743a38dec2d3c69d4ca86235d624cf959 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Thu, 4 Jan 2024 15:14:56 +0530 Subject: [PATCH 1/4] I don't know what these changes are supposed to accomplish but somebody told me to make them. Signed-off-by: Mriyam Tamuli --- .github/workflows/02-run-after-another.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/02-run-after-another.yaml b/.github/workflows/02-run-after-another.yaml index eefe117..a04c4f5 100644 --- a/.github/workflows/02-run-after-another.yaml +++ b/.github/workflows/02-run-after-another.yaml @@ -24,3 +24,5 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: | echo "$GITHUB_CONTEXT" + - name: Test step for PR + run: echo "No op step added just for testing" From 8336d3580c8a39938738579c0c16892e4b430346 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Thu, 4 Jan 2024 15:18:43 +0530 Subject: [PATCH 2/4] Fucking submodule bull shit Signed-off-by: Mriyam Tamuli --- .github/workflows/02-run-after-another.yaml | 2 +- .github/workflows/03-run-on-pr.yaml | 14 ++++++++++++++ README.md | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/03-run-on-pr.yaml diff --git a/.github/workflows/02-run-after-another.yaml b/.github/workflows/02-run-after-another.yaml index a04c4f5..12e477e 100644 --- a/.github/workflows/02-run-after-another.yaml +++ b/.github/workflows/02-run-after-another.yaml @@ -2,7 +2,7 @@ name: 02-run-after-another on: workflow_run: - workflows: [01-run-on-push] + workflows: [01-run-on-push, 03-run-on-pull-request] types: [completed] jobs: diff --git a/.github/workflows/03-run-on-pr.yaml b/.github/workflows/03-run-on-pr.yaml new file mode 100644 index 0000000..107d32b --- /dev/null +++ b/.github/workflows/03-run-on-pr.yaml @@ -0,0 +1,14 @@ +name: 01-run-on-pull-request + +on: + pull_request: + +jobs: + run-on-pull-request: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" diff --git a/README.md b/README.md index c52e582..6119913 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Various proofs of concept examples using Github Actions 🤖 | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | [![01-run-on-push](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/01-run-on-push.yaml/badge.svg)](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/01-run-on-push.yaml) | Runs on push event to any branch. | | [![02-run-after-another](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/02-run-after-another.yaml/badge.svg)](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/02-run-after-another.yaml) | Run after another workflow, in this case after [01-run-on-push](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/01-run-on-push.yaml) | +| [![03-run-on-pull-request](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/03-run-on-pull-request.yaml/badge.svg)](https://github.com/mbtamuli/github-actions-pocs/actions/workflows/03-run-on-pull-request.yaml) | Runs on pull request event for any branch. | ## Reference From ab5d44c49a23c4c62ef233878141704dc6064d29 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Thu, 4 Jan 2024 15:19:19 +0530 Subject: [PATCH 3/4] FUCKING DIMITRIS Signed-off-by: Mriyam Tamuli --- .github/workflows/03-run-on-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/03-run-on-pr.yaml b/.github/workflows/03-run-on-pr.yaml index 107d32b..5fc92ba 100644 --- a/.github/workflows/03-run-on-pr.yaml +++ b/.github/workflows/03-run-on-pr.yaml @@ -1,4 +1,4 @@ -name: 01-run-on-pull-request +name: 03-run-on-pull-request on: pull_request: From ec5cffb603796ca9581c63feb2062699ef208a80 Mon Sep 17 00:00:00 2001 From: Mriyam Tamuli Date: Thu, 4 Jan 2024 15:24:59 +0530 Subject: [PATCH 4/4] Well the book was obviously wrong. Signed-off-by: Mriyam Tamuli --- .github/workflows/01-run-on-push.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/01-run-on-push.yaml b/.github/workflows/01-run-on-push.yaml index b21b31e..d5598b2 100644 --- a/.github/workflows/01-run-on-push.yaml +++ b/.github/workflows/01-run-on-push.yaml @@ -2,6 +2,7 @@ name: 01-run-on-push on: push: + branches: [main] jobs: run-on-push: