Workflow fails No event triggers defined in `on`

I have created multiple worflow files to deploy in different environments based on the following condition

  1. Deploy to QA server, when push on qa branch
  2. Deploy to Staging server, when push on staging branch

The workflow files are

qa-deploy.yml

name: Deploy to QA

on:
  push:
    branches:
      - qa

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}

jobs:
  test:
    name: Testing
    runs-on: ubuntu-latest

staging-deploy.yml

name: Deploy to Staging

on:
  push:
    branches:
      - staging

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest

But when pushes are made to the qa branch, staging workflow is also executed and gives the following error

Error: .github#L1
No event triggers defined in `on`

while I want the pipeline to execute only when pushes are made to the respective branch only.

Hi @anuj9196 ,

We’re sorry to hear that you’re not able to use Actions. I have reported the same to the engineering team and will get back to you soon with an update.

Thanks for your patience.

We are investigating reports of degraded performance for GitHub Actions. For details, see Incident with GitHub Actions

Hi @anuj9196 ,

The incident has been resolved. If you’re still not able to run the workflow, it seems there might be an error causing it. Please share the full workflow with us so that we can review it.