Skip to content

Instantly share code, notes, and snippets.

@ali-kamalizade
Created May 18, 2022 21:41
Show Gist options
  • Save ali-kamalizade/7916725199ae5feee29e5c2f509a1321 to your computer and use it in GitHub Desktop.
Save ali-kamalizade/7916725199ae5feee29e5c2f509a1321 to your computer and use it in GitHub Desktop.
A sample GitHub workflow using the GitHub ref to conditionally skip steps
ci_web:
name: "Build & Tests & Lint"
runs-on: ubuntu-latest
steps:
- name: "Checkout project"
uses: actions/checkout@v3
- name: "Use Node.js"
uses: actions/setup-node@v3
with:
node-version-file: .node-version
- name: "Install npm dependencies"
run: "npm ci"
- name: "Lint code"
if: github.ref != 'refs/heads/main'
run: "npm run lint"
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment