GitHub Actions Workflow not getting Triggered

Advertisements

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?

>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
...

Leave a ReplyCancel reply