diff --git a/.github/workflows/end.yaml b/.github/workflows/end.yaml new file mode 100644 index 0000000..d9cc163 --- /dev/null +++ b/.github/workflows/end.yaml @@ -0,0 +1,18 @@ +name: Dependent Workflow + +on: + workflow_run: + workflows: ["Main Workflow"] + types: + - completed + +jobs: + notify: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Run a one-line script + run: echo "Hello, this is the dependent workflow running after the main workflow!" + diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..dbe80ad --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,35 @@ +name: Main Workflow + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Run a one-line script + run: echo "Hello, this is the main workflow running!" + +--- +name: Dependent Workflow + +on: + workflow_run: + workflows: ["Main Workflow"] + types: + - completed + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Run a one-line script + run: echo "Hello, this is the dependent workflow running after the main workflow!" + +