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/[email protected]
- 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/[email protected]
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?
3
Answers
Your branch specification is incorrect.
main/master
means "a branch calledmain/master
, and that doesn’t seem to exist on your repo. What you probably want is an array:If your branch is called
main/master
it’s correct, instead if your branch is justmaster
ormain
I think you need to change theON
condition like followingEdit value of key
branches
to