diff --git a/.github/workflows/main-push.yml b/.github/workflows/main-push.yml index 70df286..76d119b 100644 --- a/.github/workflows/main-push.yml +++ b/.github/workflows/main-push.yml @@ -28,13 +28,23 @@ jobs: runs-on: ubuntu-latest needs: release steps: + - name: Check for initialized + id: file_check + run: | + if ls -l catalogs | wc -l != 0; then + echo "check_result=true" >> $GITHUB_OUTPUT + else + echo "check_result=false" >> $GITHUB_OUTPUT + fi - name: Clone branch + if: steps.file_check.outputs.check_result == 'true' uses: actions/checkout@v2 with: fetch-depth: 0 ref: main token: ${{ secrets.GIT_TOKEN }} - name: Clone downstream repo + if: steps.file_check.outputs.check_result == 'true' uses: actions/checkout@v2 with: repository: my-repo-base/my-profile @@ -42,6 +52,7 @@ jobs: token: ${{ secrets.GIT_TOKEN }} fetch-depth: 0 - name: Update profiles + if: steps.file_check.outputs.check_result == 'true' run: bash scripts/automation/update_downstream.sh env: GH_TOKEN: ${{ secrets.GIT_TOKEN }}