From e4e68db2bc3326fecd7a675f6d2f68331365cefa Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Mon, 28 Oct 2024 09:58:38 -0700 Subject: [PATCH] Backport to main fixes in publishing the template (#47250) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47250 This commit backports to main [#47116](https://github.com/facebook/react-native/pull/47116) ## Changelog [Internal] - Backport fix to publishTemplate from 0.76 to main Reviewed By: blakef Differential Revision: D65066047 fbshipit-source-id: 2c8fcca8ea7b75495aa5ad1bd4e3f53379cb3246 --- .github/workflow-scripts/__tests__/publishTemplate-test.js | 4 ++-- .github/workflow-scripts/publishTemplate.js | 2 +- .github/workflow-scripts/utils.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflow-scripts/__tests__/publishTemplate-test.js b/.github/workflow-scripts/__tests__/publishTemplate-test.js index c917dad568debe..a956b922b7e113 100644 --- a/.github/workflow-scripts/__tests__/publishTemplate-test.js +++ b/.github/workflow-scripts/__tests__/publishTemplate-test.js @@ -46,7 +46,7 @@ describe('#publishTemplate', () => { expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({ owner: 'react-native-community', repo: 'template', - workflow_id: 'release.yml', + workflow_id: 'release.yaml', ref: '0.76-stable', inputs: { dry_run: true, @@ -66,7 +66,7 @@ describe('#publishTemplate', () => { expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({ owner: 'react-native-community', repo: 'template', - workflow_id: 'release.yml', + workflow_id: 'release.yaml', ref: '0.76-stable', inputs: { dry_run: false, diff --git a/.github/workflow-scripts/publishTemplate.js b/.github/workflow-scripts/publishTemplate.js index 12221c1ae756b4..b0c8946b6793df 100644 --- a/.github/workflow-scripts/publishTemplate.js +++ b/.github/workflow-scripts/publishTemplate.js @@ -42,7 +42,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => { await github.rest.actions.createWorkflowDispatch({ owner: 'react-native-community', repo: 'template', - workflow_id: 'release.yml', + workflow_id: 'release.yaml', ref, inputs: { dry_run: dryRun, diff --git a/.github/workflow-scripts/utils.js b/.github/workflow-scripts/utils.js index 1c2b8a5d1f8dbd..ddbe2b210b8967 100644 --- a/.github/workflow-scripts/utils.js +++ b/.github/workflow-scripts/utils.js @@ -9,7 +9,7 @@ const {execSync} = require('child_process'); -function run(...cmd) { +function run(cmd) { return execSync(cmd, 'utf8').toString().trim(); } module.exports.run = run;