ci: preflight checks on main

This commit is contained in:
Marc 2023-08-09 00:15:40 -04:00
parent bf7431f747
commit c541877cf7
Signed by: marc
GPG key ID: 048E042F22B5DC79

View file

@ -24,6 +24,11 @@ jobs:
- name: Change check (frontend) - name: Change check (frontend)
id: fe-changes id: fe-changes
run: | run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]
then
echo "fe_changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./frontend git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./frontend
if [ -n "$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./frontend)" ] if [ -n "$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./frontend)" ]
then then
@ -32,6 +37,11 @@ jobs:
- name: Change check (backend) - name: Change check (backend)
id: be-changes id: be-changes
run: | run: |
if [ "${{ github.ref }}" == "refs/heads/main" ]
then
echo "be_changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./backend git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./backend
if [ -n "$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./backend)" ] if [ -n "$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} -- ./backend)" ]
then then