chris
chris

Reputation: 29

GitHub Actions - having trouble getting workflow_run to work

I'm having a problem getting workflow_run to work for me. I've tried to simplify what I'm doing just to get it to work but I'm still not having any luck. This is what I have.

Workflow One:

name: First Workflow

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Build
      run: echo "Building the project..."

Workflow Two:

name: Second Workflow

on:
  workflow_run:
    workflows: ["First Workflow"]
    branches: [main]
    types:
      - completed

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Deploy
      run: echo "Deploying the project..."

Workflow One completes successfully, but Workflow Two never runs. I'd be grateful if someone could point me in the direction of where I'm going wrong.

Upvotes: 0

Views: 31

Answers (1)

yousef elsayed
yousef elsayed

Reputation: 41

Are you sure you are setting up the branch name correctly, as i take the same 2 files as they are and added them to a test repo i have and just changed the branche name to master as this is my branch name and it worked

Upvotes: 0

Related Questions