Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the PR flow of 02-run-after-another workflow #1

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/01-run-on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: 01-run-on-push

on:
push:
branches: [main]

jobs:
run-on-push:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/02-run-after-another.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
14 changes: 14 additions & 0 deletions .github/workflows/03-run-on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 03-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"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down