From 4d25b3e4b75878e3895578c4bac29f13d5870477 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Thu, 22 Oct 2026 20:55:13 +0900 Subject: [PATCH 1/5] release: Make Debian packaging branch configurable --- release/README.md | 12 +++++++++++- release/action.yml | 5 +++++ release/entrypoint.sh | 15 +++++++++++---- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/release/README.md b/release/README.md index 651c1f2..8bb502a 100644 --- a/release/README.md +++ b/release/README.md @@ -7,7 +7,7 @@ For more information on the overall flow of this ci image, take a look at the [e This image is intended for use with elementary debian projects. There are a few requirements before getting started: - 1. The project needs to have a deb-packaging branch with the necessary debian packaging for the project. + 1. The project needs to have a branch with the necessary debian packaging for the project, typically named as `deb-packaging`. 2. The project needs release information in an `appdata.xml` file. Docs: [appdata](https://docs.elementary.io/develop/writing-apps/our-first-app/metadata) ### Environment Variables @@ -30,6 +30,15 @@ with: release_branch: 'juno' ``` +### Specifying a packaging branch name + +By default, this action will update the `changelog` file in a branch named 'deb-packaging' whenever a release is pushed. The branch name can be set via the `packaging_branch` input. Example: + +```yaml +with: + packaging_branch: 'deb-packaging-juno' +``` + ### Specifying a label By default, the examples check for a label called `Release` on the related pull request. This can be set in the workflow action by changing the following: @@ -92,4 +101,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: release_branch: 'juno' + packaging_branch: 'deb-packaging-juno' ``` diff --git a/release/action.yml b/release/action.yml index e222056..4eb758d 100644 --- a/release/action.yml +++ b/release/action.yml @@ -5,11 +5,16 @@ inputs: description: 'the name of the stable release branch' required: false default: 'stable' + packaging_branch: + description: 'the name of the Debian packaging branch' + required: false + default: 'deb-packaging' runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.release_branch }} + - ${{ inputs.packaging_branch }} branding: icon: 'git-pull-request' color: 'green' diff --git a/release/entrypoint.sh b/release/entrypoint.sh index 0f01bc9..4a9f551 100755 --- a/release/entrypoint.sh +++ b/release/entrypoint.sh @@ -22,6 +22,13 @@ if [ -z "$1" ]; then else RELEASE_BRANCH="$1" fi + +if [ -z "$2" ]; then + PACKAGING_BRANCH="deb-packaging" +else + PACKAGING_BRANCH="$2" +fi + # default email and username to github actions user if [ -z "$GIT_USER_EMAIL" ]; then GIT_USER_EMAIL="action@github.com" @@ -110,8 +117,8 @@ echo "Debian Changelog Content:" echo -e "$FILTERED_COMMITS\n" # move to the debian packaging branch -if ! git checkout deb-packaging; then - echo "\033[0;31mERROR: Unable to checkout the 'deb-packaging' branch. Does it exist?\033[0m" && exit 1 +if ! git checkout "$PACKAGING_BRANCH"; then + echo "\033[0;31mERROR: Unable to checkout the '$PACKAGING_BRANCH' branch. Does it exist?\033[0m" && exit 1 fi if [ -z "$FILTERED_COMMITS" ]; then @@ -143,13 +150,13 @@ fi if ! (git push && git push origin "$TAG"); then echo "\033[0;31mERROR: Unable to push changelog information!\033[0m" && exit 1 fi -echo -e "\n\033[1;32mChangelogs have been pushed to deb-packaging!\033[0m\n" +echo -e "\n\033[1;32mChangelogs have been pushed to $PACKAGING_BRANCH!\033[0m\n" #------------------# # Deploy to stable # #------------------# -# point head back to what it was before checking out deb-packaging +# point head back to what it was before checking out the packaging branch git checkout - git reset --hard HEAD From 4bcb42dcbff72e973be9c6aa6ed15a532764af29 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Thu, 22 Oct 2026 22:31:33 +0900 Subject: [PATCH 2/5] release: Make base branch configurable --- release/README.md | 10 ++++++++++ release/action.yml | 5 +++++ release/entrypoint.sh | 16 ++++++++++------ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/release/README.md b/release/README.md index 8bb502a..9766491 100644 --- a/release/README.md +++ b/release/README.md @@ -39,6 +39,15 @@ with: packaging_branch: 'deb-packaging-juno' ``` +### Specifying a base branch name + +By default, this action will use the default branch as a base branch of the release branch. The branch name can be set via the `base_branch` input. Example: + +```yaml +with: + base_branch: '6' +``` + ### Specifying a label By default, the examples check for a label called `Release` on the related pull request. This can be set in the workflow action by changing the following: @@ -102,4 +111,5 @@ jobs: with: release_branch: 'juno' packaging_branch: 'deb-packaging-juno' + base_branch: '8' ``` diff --git a/release/action.yml b/release/action.yml index 4eb758d..2df210c 100644 --- a/release/action.yml +++ b/release/action.yml @@ -9,12 +9,17 @@ inputs: description: 'the name of the Debian packaging branch' required: false default: 'deb-packaging' + base_branch: + description: 'the name of the base branch or use the default branch if unspecified' + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.release_branch }} - ${{ inputs.packaging_branch }} + - ${{ inputs.base_branch }} branding: icon: 'git-pull-request' color: 'green' diff --git a/release/entrypoint.sh b/release/entrypoint.sh index 4a9f551..0750c1c 100755 --- a/release/entrypoint.sh +++ b/release/entrypoint.sh @@ -29,6 +29,13 @@ else PACKAGING_BRANCH="$2" fi +if [ -z "$3" ]; then + # get default branch, see: https://davidwalsh.name/get-default-branch-name + BASE_BRANCH="$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)" +else + BASE_BRANCH="$3" +fi + # default email and username to github actions user if [ -z "$GIT_USER_EMAIL" ]; then GIT_USER_EMAIL="action@github.com" @@ -160,9 +167,6 @@ echo -e "\n\033[1;32mChangelogs have been pushed to $PACKAGING_BRANCH!\033[0m\n" git checkout - git reset --hard HEAD -# get default branch, see: https://davidwalsh.name/get-default-branch-name -DEFAULT_BRANCH="$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)" - # checkout or create stable branch if ! git show-ref --verify --quiet refs/heads/"$RELEASE_BRANCH"; then git checkout -b "$RELEASE_BRANCH" @@ -170,9 +174,9 @@ else git checkout "$RELEASE_BRANCH" fi -# rebase off of default branch & push to remote -if ! git rebase origin/"$DEFAULT_BRANCH"; then - echo "\033[0;31mERROR: Unable to merge default branch $DEFAULT_BRANCH into $RELEASE_BRANCH!\033[0m" && exit 1 +# rebase off of base branch & push to remote +if ! git rebase origin/"$BASE_BRANCH"; then + echo "\033[0;31mERROR: Unable to merge base branch $BASE_BRANCH into $RELEASE_BRANCH!\033[0m" && exit 1 fi if ! git push origin "$RELEASE_BRANCH" --force-with-lease; then echo "\033[0;31mERROR: Unable to push changes to the $RELEASE_BRANCH branch!\033[0m" && exit 1 From 0dc6e2ae0f21748f8b83bf697ef845e122cdd4ab Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Tue, 3 Nov 2026 15:04:08 +0900 Subject: [PATCH 3/5] release: Use the current branch if base branch not set --- release/README.md | 2 +- release/entrypoint.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/release/README.md b/release/README.md index 9766491..91dd33e 100644 --- a/release/README.md +++ b/release/README.md @@ -41,7 +41,7 @@ with: ### Specifying a base branch name -By default, this action will use the default branch as a base branch of the release branch. The branch name can be set via the `base_branch` input. Example: +By default, this action will use the current branch where the workflow action exists as a base branch of the release branch. The branch name can be set via the `base_branch` input. Example: ```yaml with: diff --git a/release/entrypoint.sh b/release/entrypoint.sh index 0750c1c..bf8eb31 100755 --- a/release/entrypoint.sh +++ b/release/entrypoint.sh @@ -30,8 +30,7 @@ else fi if [ -z "$3" ]; then - # get default branch, see: https://davidwalsh.name/get-default-branch-name - BASE_BRANCH="$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)" + BASE_BRANCH="$(git branch --show-current)" else BASE_BRANCH="$3" fi From 21130a68f2b9fc75c24848b4c5933553db70b25a Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Tue, 3 Nov 2026 15:07:35 +0900 Subject: [PATCH 4/5] release: Improve example in README --- release/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/README.md b/release/README.md index 91dd33e..ba0e578 100644 --- a/release/README.md +++ b/release/README.md @@ -45,7 +45,7 @@ By default, this action will use the current branch where the workflow action ex ```yaml with: - base_branch: '6' + base_branch: 'develop' ``` ### Specifying a label @@ -111,5 +111,5 @@ jobs: with: release_branch: 'juno' packaging_branch: 'deb-packaging-juno' - base_branch: '8' + base_branch: '5.x' ``` From 83cb9c008b04a31d80950aac048d026c86f17328 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Tue, 3 Nov 2026 15:23:18 +0900 Subject: [PATCH 5/5] release: Fix leftover --- release/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/action.yml b/release/action.yml index 2df210c..509d89c 100644 --- a/release/action.yml +++ b/release/action.yml @@ -10,7 +10,7 @@ inputs: required: false default: 'deb-packaging' base_branch: - description: 'the name of the base branch or use the default branch if unspecified' + description: 'the name of the base branch or use the current branch where the workflow action exists if unspecified' required: false default: '' runs: