From 1814893b8c0a0fb267c4d20f4812ef3b9b3716a4 Mon Sep 17 00:00:00 2001 From: SoundDrill31 <84176052+sounddrill31@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:51:58 +0530 Subject: [PATCH] Use if/else inside the first block --- .github/workflows/main.yml | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daa60a4..7f9fa9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,27 +37,30 @@ jobs: sudo apt-get update sudo apt-get install -y git-core python3-pip wget wget https://storage.googleapis.com/git-repo-downloads/repo && sudo mv repo /usr/bin/repo && sudo chmod a+x /usr/bin/repo - - name: Initialize and Sync Repo for ROM Manifest - if: ["${{ github.event.inputs.choice }}" == "ROM_MANIFEST"]; then + - name: Initialize and Sync Repo for Manifest run: | mkdir workspace cd workspace echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT git config --global user.name ${{ github.event.inputs.GIT_USERNAME }} git config --global user.email ${{ github.event.inputs.GIT_EMAIL }} - repo init --depth=1 -u ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} + if [ "${{ github.event.inputs.choice }}" == "ROM_MANIFEST" ]; then + repo init --depth=1 -u ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} + else + git clone ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} .repo/local_manifests + repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp -b twrp-12.1 timeout 1m repo sync || true timeout-minutes: 6 - - name: Initialize and Sync Repo for Local Manifest - if: ["${{ github.event.inputs.choice }}" == "LOCAL_MANIFEST"]; then - run: | - mkdir workspace - cd workspace - echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT - git config --global user.name ${{ github.event.inputs.GIT_USERNAME }} - git config --global user.email ${{ github.event.inputs.GIT_EMAIL }} - git clone ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} .repo/local_manifests - repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp -b twrp-12.1 - timeout 1m repo sync || true - timeout-minutes: 6 - id: pwd \ No newline at end of file + #- name: Initialize and Sync Repo for Local Manifest + # if: ["${{ github.event.inputs.choice }}" == "LOCAL_MANIFEST"]; then + # run: | + # mkdir workspace + # cd workspace + # echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT + # git config --global user.name ${{ github.event.inputs.GIT_USERNAME }} + # git config --global user.email ${{ github.event.inputs.GIT_EMAIL }} + # git clone ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} .repo/local_manifests + # repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp -b twrp-12.1 + # timeout 1m repo sync || true + # timeout-minutes: 6 + # id: pwd \ No newline at end of file