I have a project in Github, which has 2 branches - dev & master. Each branch has a different workflow yml file. On pull request from dev to master it also includes the dev's yml file in the changes. How can i make the .github/workflows ignored on pr's? Is it even possible?
All workflows will eventually end up in master branch. For whatever branch you want your workflow to run on, specify that in the branch-specific workflow.
If you want your develop.yml file to run only on the develop branch, specify that with "on develop." This workflow will only run on the develop branch and not main, staging or test. It might begin something like this:
name: Run tests for development environment
on:
push:
branches: ["develop"]
Your main branch workflow might begin like this:
name: Deploy to Amazon ECS
on:
pull_request:
types: [closed]
branches: [ "main" ]