From 1a4a7b247d60866dbd6c4d98705ceadb891b0d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Costa?= Date: Fri, 20 Dec 2024 15:51:57 -0300 Subject: [PATCH 1/2] Fix a small bug in the dependency CI --- .github/workflows/dependency-zip.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependency-zip.yml b/.github/workflows/dependency-zip.yml index 14a9792..1fc8b37 100644 --- a/.github/workflows/dependency-zip.yml +++ b/.github/workflows/dependency-zip.yml @@ -78,15 +78,13 @@ jobs: needs: - prepare - # If the head branch is main, we don't need to check the dependency branch, as we will use the release zip. - if: ${{ needs.prepare.outputs.is-main == 'false' }} - outputs: branch-to-checkout: ${{ steps.output_values.outputs.dependency_branch }} is-main: ${{ steps.output_values.outputs.dependency_branch == inputs.main-branch }} steps: - name: Checkout dependency to verify the available branches + if: ${{ needs.prepare.outputs.is-main == 'false' }} uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} @@ -98,6 +96,12 @@ jobs: - name: Check if the required branch exists id: output_values run: | + + if [ "${{ needs.prepare.outputs.is-main }}" = "true" ]; then + echo "dependency_branch=${{ inputs.main-branch }}" >> $GITHUB_OUTPUT + exit 0 + fi + cd ${{ needs.prepare.outputs.checkout-path }} head_branch_exists=$(git ls-remote --heads origin ${{ needs.prepare.outputs.head-branch }} | wc -l) From 9aea601c9cf2c9aebc6a8745c20eec5c106b0d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Costa?= Date: Fri, 20 Dec 2024 15:53:35 -0300 Subject: [PATCH 2/2] Fix a small bug in the dependency CI --- .github/workflows/dependency-zip.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dependency-zip.yml b/.github/workflows/dependency-zip.yml index 1fc8b37..e864d02 100644 --- a/.github/workflows/dependency-zip.yml +++ b/.github/workflows/dependency-zip.yml @@ -131,7 +131,7 @@ jobs: steps: - name: Checkout dependency - if: ${{ needs.prepare.outputs.is-main == 'false' && needs.check-branch.outputs.is-main == 'false' }} + if: ${{ needs.check-branch.outputs.is-main == 'false' }} uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} @@ -141,7 +141,7 @@ jobs: token: ${{ secrets.GITHUB_CHECKOUT_TOKEN }} - name: Define the dependency zip name - if: ${{ needs.prepare.outputs.is-main == 'false' && needs.check-branch.outputs.is-main == 'false' }} + if: ${{ needs.check-branch.outputs.is-main == 'false' }} run: | cd ${{ needs.prepare.outputs.checkout-path }} composer -- pup @@ -149,7 +149,7 @@ jobs: echo "DEPENDENCY_ZIP_NAME=$(composer -- pup zip-name $version).zip" >> $GITHUB_ENV - name: Check if the zip exists in S3 - if: ${{ needs.prepare.outputs.is-main == 'false' && needs.check-branch.outputs.is-main == 'false' }} + if: ${{ needs.check-branch.outputs.is-main == 'false' }} uses: the-events-calendar/action-s3-utility@main id: s3_zip_exists continue-on-error: true @@ -167,7 +167,7 @@ jobs: run: | # use the release zip if the file does not exists or is main - if [ "${{ needs.prepare.outputs.is-main }}" = "true" ] || [ "${{ needs.check-branch.outputs.is-main }}" = "true" ] || [ "${{ steps.s3_zip_exists.outcome }}" != "success" ]; then + if [ "${{ needs.check-branch.outputs.is-main }}" = "true" ] || [ "${{ steps.s3_zip_exists.outcome }}" != "success" ]; then echo 'use-release=true' >> $GITHUB_OUTPUT else echo 'use-release=false' >> $GITHUB_OUTPUT