Skip to content

Commit

Permalink
sync branch with origin/main (#5483)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
github-actions[bot] and github-actions authored Oct 5, 2023
1 parent 587bba5 commit df2cf35
Showing 1 changed file with 4 additions and 38 deletions.
42 changes: 4 additions & 38 deletions .github/workflows/generate-release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: 'Generate release notes'
run-name: '[${{ github.ref_name }}] Generate release notes (test: ${{ inputs.test_run }})'
run-name: '[${{ github.ref_name }}] Generate release notes'

on:
workflow_dispatch:
inputs:
test_run:
description: 'Test run?'
required: true
type: boolean

permissions: {}

Expand Down Expand Up @@ -39,27 +34,14 @@ jobs:
versionFile="./eng/Versions.props"
release_version=$(perl -ne '/<VersionPrefix>([^<]*)/ && print $1' $versionFile)
release_version_label=$(perl -ne '/<PreReleaseVersionLabel>([^<]*)/ && print $1' $versionFile)
major_minor_version=${release_version%.*}
if [[ "$TEST_RUN" == "true" ]]; then
qualified_release_version="test-$release_version"
else
version_url="https://aka.ms/dotnet/diagnostics/monitor${major_minor_version}/release/dotnet-monitor.version"
qualified_release_version=$(curl -sL $version_url)
# Check if the aka.ms url existed
if [[ "$qualified_release_version" =~ "<html" || -z "$qualified_release_version" ]]; then
echo "Could not determine qualified release version, $version_url did not contain the expected information"
exit 1
fi
# trim the return carriage
qualified_release_version=$(echo $qualified_release_version | tr -d '\r')
fi
release_version_iteration=$(perl -ne '/<PreReleaseVersionIteration>([^<]*)/ && print $1' $versionFile)
friendly_release_name=""
qualified_release_version="$release_version-$release_version_label.$release_version_iteration"
if [ "$release_version_label" == "rtm" ] || [ "$release_version_label" == "servicing" ]; then
friendly_release_name="$release_version build"
qualified_release_version="$release_version"
elif [ "$release_version_label" == "rc" ]; then
friendly_release_name="official $release_version Release Candidate"
else
Expand All @@ -70,8 +52,6 @@ jobs:
echo "release_note_path=$release_note_path" >> $GITHUB_ENV
echo "friendly_release_name=$friendly_release_name" >> $GITHUB_ENV
echo "qualified_release_version=$qualified_release_version" >> $GITHUB_ENV
env:
TEST_RUN: ${{ inputs.test_run }}
- name: Checkout main
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -88,21 +68,7 @@ jobs:
auth_token: ${{ secrets.GITHUB_TOKEN }}
branch_name: ${{ github.ref_name }}

- name: Open PR (test run)
if: ${{ inputs.test_run }}
uses: ./.github/actions/open-pr
with:
draft: true
files_to_commit: ${{ env.release_note_path }}
title: "[test] Add ${{ env.qualified_release_version }} release notes"
commit_message: generate release notes
body: This is a test PR. Add ${{ env.qualified_release_version }} release notes. This PR was auto generated and will not be automatically merged in.
branch_name: releaseNotes/test/${{ env.qualified_release_version }}
fail_if_files_unchanged: true
auth_token: ${{ secrets.GITHUB_TOKEN }}

- name: Open PR
if: ${{ !inputs.test_run }}
uses: ./.github/actions/open-pr
with:
files_to_commit: ${{ env.release_note_path }}
Expand Down

0 comments on commit df2cf35

Please sign in to comment.