Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/test release workflow 1 #1977

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Pull Request Merge
on:
pull_request:
types: [closed]
branches:
- 'release/*'

jobs:
create_release:
Expand All @@ -19,14 +17,34 @@ jobs:
fetch-depth: 0

# Getting the description for the pull request that was merged
- name: Fetch Pull Request Description
- name: Fetch Pull Request Details
run: |
SOURCE_BRANCH=$(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH")
if [[ "$SOURCE_BRANCH" != release/* ]]; then
echo "Source branch does not match pattern. Exiting."
else
echo "Source branch was 'release/*'"
fi

MERGE_COMMIT_SHA=$(jq --raw-output .pull_request.merge_commit_sha "$GITHUB_EVENT_PATH")
echo "MERGE_COMMIT_SHA=$MERGE_COMMIT_SHA" >> $GITHUB_ENV

PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
PR_DESCRIPTION=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER} | jq --raw-output .body)
echo "PR_DESCRIPTION=$PR_DESCRIPTION" >> $GITHUB_ENV

echo "$PR_DESCRIPTION" >> "${{ github.workspace }}/release_notes.md"
- name: Create Release
run: |
echo "Creating Release for Version: ???"
echo "Description: ${{ env.PR_DESCRIPTION }}"
echo "The merge commit is: ${{ env.MERGE_COMMIT_SHA }}"

# - name: Draft Release
# uses: softprops/action-gh-release@v2
# with:
# body_path: "${{ github.workspace }}/release_notes.md"
# draft: true
# target_commitish: "develop" # Needs to be replaced by the merge commit of the PR
# tag_name: "X.X.X"
# token: ${{ secrets.GITHUB_TOKEN }}
Loading