Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

GitHub Actions Workflow not getting Triggered

I have the following yml file as my GitHub workflow:

name: Lint and Test Charts

on:
  push:
    branches: [ main/master ]
  pull_request:
    branches: [ main/master ]
    paths:
      - 'open-electrons-monitoring/**'
      - "!**/README.md"
      - "!images/**"
      - "!README.md"

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Install Helm
        uses: azure/setup-helm@v1

      - uses: actions/setup-python@v2
        with:
          python-version: 3.7

      - name: Install chart-testing
        uses: helm/chart-testing-action@v2.0.1

      - name: Run chart-testing (list-changed)
        id: list-changed
        run: |
          changed=$(ct list-changed)
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi

      - name: Run chart-testing (lint)
        run: ct lint

      - name: Create kind cluster
        uses: helm/kind-action@v1.0.0
        if: steps.list-changed.outputs.changed == 'true'

      - name: Run chart-testing (install)
        run: ct install

This file is defined inside .github/workflows and as it can be seen that I want to run it upon any push to the master branch. But strangely it seems not to be triggered. I also checked my default branch which is master, so I do not see any reason as to why this should not get triggered?

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Your branch specification is incorrect. main/master means "a branch called main/master, and that doesn’t seem to exist on your repo. What you probably want is an array:

on:
  push:
    branches:
      - main
      - master
  pull_request:
    branches:
      - main
      - master
...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading