From d54ae455a84ccac5aeece8363bad01a17bc2d8fa Mon Sep 17 00:00:00 2001 From: noderik Date: Tue, 17 Mar 2026 19:51:41 +0100 Subject: [PATCH] workflows: Disable "Make everything of selfie on docker" in private repositories. Apply refactoring. --- .github/workflows/selfie.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/selfie.yml b/.github/workflows/selfie.yml index 4ec375f4..79fdf5cd 100644 --- a/.github/workflows/selfie.yml +++ b/.github/workflows/selfie.yml @@ -96,7 +96,14 @@ jobs: make-everything-on-docker: name: Make everything of selfie on docker runs-on: ubuntu-latest - if: ${{ ((github.event_name != 'workflow_dispatch') || (github.event.inputs.rundocker == 'true')) && (((!github.event.repository.private) || ((github.ref == 'refs/heads/main') && (github.event_name != 'schedule'))) || (github.event_name == 'workflow_dispatch')) }} + # 1. Workflow is triggered by event workflow_dispatch. + # 2. Repository isn't private and workflow is triggered by push/pull to the main branch. + # 3. Repository isn't private and workflow is triggered by cron schedule. + if : ${{ + ((github.event_name == 'workflow_dispatch') && github.event.inputs.rundocker) || + (!github.event.repository.private && (github.ref == 'refs/heads/main') && (github.event_name != 'schedule')) || + (!github.event.repository.private && (github.event_name == 'schedule')) + }} # usage: optional run argument --platform=linux/amd64 or --platform=linux/arm64 # @@ -136,4 +143,4 @@ jobs: if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'cksystemsteaching/selfie' }} run: | echo '${{ secrets.DOCKERHUB_PASSWORD }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - docker push -a cksystemsteaching/selfie \ No newline at end of file + docker push -a cksystemsteaching/selfie