From c9fec3bc74cd3cf80d0cb0ab8147cff8085906a2 Mon Sep 17 00:00:00 2001 From: Ben Knutson Date: Wed, 18 Feb 2026 12:13:02 +0000 Subject: [PATCH] Refactor Github Action per b/485167538 --- .github/workflows/check-changeset.yml | 10 +++++--- .github/workflows/e2e-test.yml | 6 +++-- .github/workflows/merge-release-branch.yml | 4 +++- .../workflows/prerelease-manual-deploy.yml | 6 +++-- .github/workflows/release-prod.yml | 8 +++++-- .github/workflows/release-staging.yml | 23 +++++++++++++------ 6 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index fa93c2c6cc..6615c583dc 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -49,10 +49,14 @@ jobs: - name: Print changeset checker output run: | cat << 'eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE' - ${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} + ${STEPS_CHECK_CHANGESET_OUTPUTS_CHANGESET_ERROR_MESSAGE} eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE + env: + STEPS_CHECK_CHANGESET_OUTPUTS_CHANGESET_ERROR_MESSAGE: ${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}} - name: Print blocking failure status - run: echo "${{steps.check-changeset.outputs.BLOCKING_FAILURE}}" + run: echo "${STEPS_CHECK_CHANGESET_OUTPUTS_BLOCKING_FAILURE}" + env: + STEPS_CHECK_CHANGESET_OUTPUTS_BLOCKING_FAILURE: ${{steps.check-changeset.outputs.BLOCKING_FAILURE}} - name: Find Comment uses: peter-evans/find-comment@v3 id: fc @@ -89,4 +93,4 @@ jobs: # Don't want it to throw before editing the comment. - name: Fail if checker script logged a blocking failure if: ${{steps.check-changeset.outputs.BLOCKING_FAILURE == 'true'}} - run: exit 1 \ No newline at end of file + run: exit 1 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index f22f77e0fe..5272e7b631 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -52,9 +52,11 @@ jobs: echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js - name: Yarn install run: | - echo "Installing firebase@${{ github.event.client_payload.versionOrTag }}" - yarn add firebase@${{ github.event.client_payload.versionOrTag }} + echo "Installing firebase@${GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG}" + yarn add firebase@${GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG} yarn + env: + GITHUB_EVENT_CLIENT_PAYLOAD_VERSIONORTAG: ${{ github.event.client_payload.versionOrTag }} - name: Deploy "callTest" cloud function run: | pushd functions diff --git a/.github/workflows/merge-release-branch.yml b/.github/workflows/merge-release-branch.yml index 19a3f6efd8..4f20ea1786 100644 --- a/.github/workflows/merge-release-branch.yml +++ b/.github/workflows/merge-release-branch.yml @@ -35,7 +35,9 @@ jobs: echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT - name: Echo version in shell run: | - echo "Merging release ${{ steps.get-version.outputs.RELEASE_VERSION }}" + echo "Merging release ${STEPS_GET_VERSION_OUTPUTS_RELEASE_VERSION}" + env: + STEPS_GET_VERSION_OUTPUTS_RELEASE_VERSION: ${{ steps.get-version.outputs.RELEASE_VERSION }} - name: Merge to main uses: actions/github-script@v6 with: diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index 7821734e85..84e9e47026 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -41,7 +41,7 @@ jobs: - name: Yarn install run: yarn - name: Deploy prerelease - run: yarn release custom -p ${{ github.event.inputs.prereleaseName }} -t ${{ github.event.inputs.npmTag }} + run: yarn release custom -p ${GITHUB_EVENT_INPUTS_PRERELEASENAME} -t ${GITHUB_EVENT_INPUTS_NPMTAG} env: NPM_TOKEN_ANALYTICS: ${{secrets.NPM_TOKEN_ANALYTICS}} NPM_TOKEN_ANALYTICS_INTEROP_TYPES: ${{secrets.NPM_TOKEN_ANALYTICS_INTEROP_TYPES}} @@ -92,4 +92,6 @@ jobs: NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }} NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }} CI: true - \ No newline at end of file + GITHUB_EVENT_INPUTS_PRERELEASENAME: ${{ github.event.inputs.prereleaseName }} + GITHUB_EVENT_INPUTS_NPMTAG: ${{ github.event.inputs.npmTag }} + diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 1ac9d1f3ee..0b499cf8cd 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -111,16 +111,20 @@ jobs: echo "BASE_VERSION=$VERSION" >> $GITHUB_OUTPUT - name: Echo version in shell run: | - echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}" + echo "Base version: ${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}" + env: + STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }} - name: Log to release tracker # Sends release information to cloud functions endpoint of release tracker. run: | DATE=$(date +'%m/%d/%Y') - BASE_VERSION=${{ steps.get-version.outputs.BASE_VERSION }} + BASE_VERSION=${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION} RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }} curl -X POST -H "Content-Type:application/json" \ -d "{\"version\":\"$BASE_VERSION\",\"date\":\"$DATE\"}" \ $RELEASE_TRACKER_URL/logProduction + env: + STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }} - name: Create GitHub release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 94b66c6c7a..181c5a250c 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -141,19 +141,24 @@ jobs: echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_OUTPUT - name: Echo versions in shell run: | - echo "Staging release ${{ steps.get-version.outputs.STAGING_VERSION }}" - echo "Base version: ${{ steps.get-version.outputs.BASE_VERSION }}" + echo "Staging release ${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION}" + echo "Base version: ${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION}" + env: + STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }} + STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }} - name: Launch E2E tests workflow # Trigger e2e-test.yml run: | OSS_BOT_GITHUB_TOKEN=${{ secrets.OSS_BOT_GITHUB_TOKEN }} - VERSION_OR_TAG=${{ steps.get-version.outputs.STAGING_VERSION }} + VERSION_OR_TAG=${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION} curl -X POST \ -H "Content-Type:application/json" \ -H "Accept:application/vnd.github.v3+json" \ -H "Authorization:Bearer $OSS_BOT_GITHUB_TOKEN" \ -d "{\"event_type\":\"staging-tests\", \"client_payload\":{\"versionOrTag\":\"$VERSION_OR_TAG\"}}" \ https://api.github.com/repos/firebase/firebase-js-sdk/dispatches + env: + STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }} - name: Check for changes requiring a reference doc publish id: docs-check # If a diff is found (length of DIFF_CONTENTS > 0) it will write DOCS_NEEDED=true @@ -171,11 +176,15 @@ jobs: if: ${{ always() }} run: | DATE=$(date +'%m/%d/%Y') - BASE_VERSION=${{ steps.get-version.outputs.BASE_VERSION }} - STAGING_VERSION=${{ steps.get-version.outputs.STAGING_VERSION }} - OPERATOR=${{ github.actor }} + BASE_VERSION=${STEPS_GET_VERSION_OUTPUTS_BASE_VERSION} + STAGING_VERSION=${STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION} + OPERATOR=${GITHUB_ACTOR} RELEASE_TRACKER_URL=${{ secrets.RELEASE_TRACKER_URL }} - DOCS_NEEDED=${{ steps.docs-check.outputs.DOCS_NEEDED }} + DOCS_NEEDED=${STEPS_DOCS_CHECK_OUTPUTS_DOCS_NEEDED} curl -X POST -H "Content-Type:application/json" \ -d "{\"version\":\"$BASE_VERSION\",\"tag\":\"$STAGING_VERSION\",\"date\":\"$DATE\",\"operator\":\"$OPERATOR\",\"docs_needed\":\"$DOCS_NEEDED\"}" \ $RELEASE_TRACKER_URL/logStaging + env: + STEPS_GET_VERSION_OUTPUTS_BASE_VERSION: ${{ steps.get-version.outputs.BASE_VERSION }} + STEPS_GET_VERSION_OUTPUTS_STAGING_VERSION: ${{ steps.get-version.outputs.STAGING_VERSION }} + STEPS_DOCS_CHECK_OUTPUTS_DOCS_NEEDED: ${{ steps.docs-check.outputs.DOCS_NEEDED }}