Skip to content

How to trigger github action ci for tags and branch push #48858

Answered by jge162
code-R asked this question in Actions
Discussion options

You must be logged in to vote

@code-R it is possible to define multiple paths for the push event and exclude specific paths for certain conditions such as tags. here is an example pseudo code.

on:
  push:
    branches:
      - main
    paths:
      - "common/**"
      - "myservice/**"
    if: "!startsWith(github.ref, 'refs/tags/')"

  push:
    tags:
      - "*"
    branches:
      - main
    if: "startsWith(github.ref, 'refs/tags/')"

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@code-R
Comment options

@jge162
Comment options

@jge162
Comment options

@jge162
Comment options

@code-R
Comment options

Answer selected by code-R
Comment options

You must be logged in to vote
2 replies
@jge162
Comment options

@code-R
Comment options

Comment options

You must be logged in to vote
4 replies
@jge162
Comment options

@jeetkn
Comment options

@jge162
Comment options

@jeetkn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
3 participants