From c7457c846974cac82bcb487e228c70dbd1b3bc10 Mon Sep 17 00:00:00 2001 From: Pavindu Lakshan Date: Sat, 4 May 2024 17:39:44 +0530 Subject: [PATCH 1/2] Copy release script in the master branch to hotfix branch when creating a hotfix branch --- .github/workflows/hotfix-branch-creation.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/hotfix-branch-creation.yml b/.github/workflows/hotfix-branch-creation.yml index e1a91fb21e5..42e02b8a627 100644 --- a/.github/workflows/hotfix-branch-creation.yml +++ b/.github/workflows/hotfix-branch-creation.yml @@ -106,6 +106,14 @@ jobs: # Change the branch name in the pr-builder.yml file. sed -i '/branches: \[ master \]/s/master/hotfix-'"${TAG//\//\\/}"'/' .github/workflows/pr-builder.yml + # Check out the release script from master branch. + # + # Note: This is done due to the hotfix workflow for identity-apps was added recently and therefore + # the related changes to release script are not present in the older app versions. We may be able to + # remove this line once the older app versions are not being used, as by that time, the updated release script + # will be present in app versions that need to be hotfixed. + git checkout master -- .github/workflows/scripts/release.sh + # Add only modified files, hotfix-pr-creation-template.yml file, and commit changes. echo "Add only modified files." git add -u From 152602600f68cfeeb6ff01b9bf5985eec03c7438 Mon Sep 17 00:00:00 2001 From: Pavindu Lakshan Date: Sat, 4 May 2024 17:48:20 +0530 Subject: [PATCH 2/2] Checkout release workflow from master branch --- .github/workflows/hotfix-branch-creation.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/hotfix-branch-creation.yml b/.github/workflows/hotfix-branch-creation.yml index 42e02b8a627..dffd1e3eeb1 100644 --- a/.github/workflows/hotfix-branch-creation.yml +++ b/.github/workflows/hotfix-branch-creation.yml @@ -90,6 +90,17 @@ jobs: # Change the Release workflow to work with the hotfix branch. echo "Changing the Release workflow to work with the hotfix branch." + # Check out the release script and release workflow from master branch. + # + # Note: This is done due to the hotfix workflow for identity-apps was added recently and therefore + # the related changes to release script[1] are not present in the older app versions. We may be able to + # remove this line once the older app versions are not being used, as by that time, the updated release script + # will be present in app versions that need to be hotfixed. + # + # [1] https://github.com/wso2/identity-apps/pull/6049 + git checkout master -- .github/workflows/scripts/release.sh + git checkout master -- .github/workflows/release-workflow.yml + # Change the branch name in the release.yml file. sed -i '/branches: \[ master \]/s/master/hotfix-'"${TAG//\//\\/}"'/' .github/workflows/release-workflow.yml sed -i 's/BRANCH: .*/BRANCH: hotfix-'"${TAG//\//\\/}"'/' .github/workflows/release-workflow.yml @@ -106,14 +117,6 @@ jobs: # Change the branch name in the pr-builder.yml file. sed -i '/branches: \[ master \]/s/master/hotfix-'"${TAG//\//\\/}"'/' .github/workflows/pr-builder.yml - # Check out the release script from master branch. - # - # Note: This is done due to the hotfix workflow for identity-apps was added recently and therefore - # the related changes to release script are not present in the older app versions. We may be able to - # remove this line once the older app versions are not being used, as by that time, the updated release script - # will be present in app versions that need to be hotfixed. - git checkout master -- .github/workflows/scripts/release.sh - # Add only modified files, hotfix-pr-creation-template.yml file, and commit changes. echo "Add only modified files." git add -u