From b4a2a4e756fa92e1c313c6e4538bef1e9be5d864 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 15 Aug 2024 06:40:40 -0700 Subject: [PATCH] Backport Fixes for Create Release Workflow (#46034) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46034 The create release workflow was not working properly for 0.75: * the latest tag was not pushed because we were using the wrong input * the latest tag was not deleted because we were not fetching all the tags * the create release job 'dry-run' defaults to false, which is a bit dangerous This change is a backport from 0.75 to main of these changes. ## Changelog [Internal] - Make sure that the Latest tag is properly pushed to github while releasing Reviewed By: cortinico Differential Revision: D61331247 fbshipit-source-id: 89bf0698c45ec6c766e25b11599dbe926d8a6297 --- .github/actions/create-release/action.yml | 2 +- .github/workflows/create-release.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/create-release/action.yml b/.github/actions/create-release/action.yml index c5e58348dfb..0d0f2055f03 100644 --- a/.github/actions/create-release/action.yml +++ b/.github/actions/create-release/action.yml @@ -31,7 +31,7 @@ runs: GIT_PAGER=cat git show HEAD - name: Update "latest" tag if needed shell: bash - if: ${{ inputs.tag == 'latest' }} + if: ${{ inputs.is-latest-on-npm == 'true' }} run: | git tag -d "latest" git push origin :latest diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 3807ca530f3..ae5800f81ee 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -15,7 +15,7 @@ on: dry-run: description: "Whether the job should be executed in dry-run mode or not" type: boolean - default: false + default: true jobs: create_release: @@ -25,6 +25,8 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }} + fetch-depth: 0 + fetch-tags: 'true' - name: Check if on stable branch id: check_stable_branch run: |