diff --git a/.changelog/ecd1c6a8a43c45ceb35e58c112d7ba27.md b/.changelog/ecd1c6a8a43c45ceb35e58c112d7ba27.md new file mode 100644 index 0000000..10eb7c3 --- /dev/null +++ b/.changelog/ecd1c6a8a43c45ceb35e58c112d7ba27.md @@ -0,0 +1,4 @@ +--- +type: none +--- +Push slash_command changes to correct branch \ No newline at end of file diff --git a/.github/workflows/slash_commands.yml b/.github/workflows/slash_commands.yml index 6bd336d..a1b5145 100644 --- a/.github/workflows/slash_commands.yml +++ b/.github/workflows/slash_commands.yml @@ -53,6 +53,12 @@ jobs: git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + # Get the branch name from the PR using GitHub API + branch=$(curl -s -H "Authorization: token ${{ github.token }}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}" | \ + jq -r .head.ref) + echo "Branch: $branch" + ./script/changelog create -c -t "${{ steps.parse_command.outputs.changelog_type }}" "${{ steps.parse_command.outputs.message }}" - git push origin HEAD:refs/pull/${{ github.event.issue.number }}/head + git push origin HEAD:"$branch"