-
Notifications
You must be signed in to change notification settings - Fork 34
Description
In two places in the CI (and at two in the doc-comments) the branch name is assumed to be main (vs master, trunk, etc.).
This will silently break the CI and leave the user (who presumably was attempting to avoid workflow yml mucking) to find out why the ci won't run correctly. Whatever one's feelings on branch naming a great many projects cannot practically change their name (and all downstreams names and remotes) and master remains the default branch created by git, e.g. when a beginner is early in their explorations.
Taking primary branch name as a variable would likely be the simplest workaround. If detecting all branches to search for common branch names were practical that would be ideal. But, if neither of those occurs, a very bold warning that the branch name may need to be manually edited would likely be wise.
on:
...
# Whenever something gets pushed to main, update the docs! # <<<<<<<<<<<<<<<<< (comment a)
...
push:
branches:
- main # <<<<<<<<<<<<<< (1)
# ONLY if we're on main (so no PRs or feature branches allowed!)
if: ${{ github.ref == 'refs/heads/main' }}
- name: Deploy to Github Pages
uses: JamesIves/[email protected]
# ONLY if we're on main (so no PRs or feature branches allowed!) # <<<<<<<<<<<<<<<<<<< (comment b)
if: ${{ github.ref == 'refs/heads/main' }} # <<<<<<<<<<<<<<<<<<< (2)
with:
branch: gh-pages