From fd68ffdb13e27ab74f3df6590cd8f78e94e3c650 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Fri, 6 Sep 2024 14:28:11 -0600 Subject: [PATCH] fixed validation publish condition --- .github/workflows/checks.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 278167c..216b564 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -83,12 +83,18 @@ jobs: - id: analyze-pubspec working-directory: ${{ inputs.package-path }} run: | - echo "package_name=$(yq '.name' pubspec.yaml)" >> $GITHUB_OUTPUT - echo "package_version=$(yq '.version' pubspec.yaml)" >> $GITHUB_OUTPUT + PACKAGE_NAME=$(yq '.name' pubspec.yaml) + PACKAGE_VERSION=$(yq '.version' pubspec.yaml) + echo "release_ref=refs/head/release_$PACKAGE_NAME_$PACKAGE_VERSION" >> $GITHUB_ENV + + - name: Debug + run: | + echo "Current Ref: ${{ github.ref}}" + echo "Analyzed Release Ref: ${{ steps.analyze-pubspec.outputs.release_ref }}" - name: Validate Publish # Only validate the publish for release pull requests, as determined by the branch name - if: github.ref == format('refs/head/release_{0}_{1}', steps.analyze-pubspec.outputs.package_name, steps.analyze-pubspec.outputs.package_version) + if: github.ref == steps.analyze-pubspec.outputs.release_ref run: dart pub publish --dry-run analyze-additional-checks: