From 5bd80abd110a97645cb90216343da651efd46e16 Mon Sep 17 00:00:00 2001 From: Miroslav Date: Fri, 20 Nov 2020 20:37:21 +0100 Subject: [PATCH 01/10] Fixes getURL() error in project updates page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is fixing a bug in the /project-updates page (https://github.com/codeforcroatia/codeforcroatia.org/issues/72): ```

- {capture assign=projectTitleLink}{$Project->Title|escape}{/capture} {if $Project} + {capture assign=projectTitleLink}{$Project->Title|escape}{/capture} {sprintf(_("Project Updates in %s"), $projectTitleLink)} {else} {_ "Project Updates"} From 74910f6f3c8861fa0aa888cbb6f15c097e5c94b2 Mon Sep 17 00:00:00 2001 From: Miroslav Date: Fri, 20 Nov 2020 21:57:23 +0100 Subject: [PATCH 02/10] Fixes translation strings Fixing https://github.com/codeforcroatia/codeforcroatia.org/issues/74 --- html-templates/confirm.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html-templates/confirm.tpl b/html-templates/confirm.tpl index febbcd45..a4f4b5ec 100644 --- a/html-templates/confirm.tpl +++ b/html-templates/confirm.tpl @@ -12,8 +12,8 @@

{$question}

- - + +
From a2bb41c1b3d7376421558a7a9e63f7348c7e52d8 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Wed, 25 Nov 2020 11:13:20 -0500 Subject: [PATCH 03/10] fix: suppress fetch errors from iCal parser --- php-classes/Emergence/Meetup/Connector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-classes/Emergence/Meetup/Connector.php b/php-classes/Emergence/Meetup/Connector.php index 9c629b3f..07f05546 100644 --- a/php-classes/Emergence/Meetup/Connector.php +++ b/php-classes/Emergence/Meetup/Connector.php @@ -25,7 +25,7 @@ public static function getUpcomingEvents() throw new Exception('meetup feed unavailable'); } elseif (false === $events) { $cal = new IcalParser(); - $cal->parseFile("https://www.meetup.com/{$groupSlug}/events/ical/"); + @$cal->parseFile("https://www.meetup.com/{$groupSlug}/events/ical/"); $events = []; foreach ($cal->getSortedEvents() as $event) { From e9afc4b2e9be448ad9c835d1545faa12557ab83c Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Sun, 31 Jan 2021 04:29:21 +0000 Subject: [PATCH 04/10] feat: set up docs site --- .github/workflows/website.yml | 18 ++++++++++++++++++ .holo/branches/docs-site/_laddr.toml | 5 +++++ .holo/branches/docs-site/_skeleton-v2.toml | 4 ++++ .../branches/emergence-site/_skeleton-v2.toml | 1 + .holo/sources/skeleton-v2.toml | 2 +- docs/{laddr => }/development/clone-from-git.md | 0 mkdocs.site.yml | 4 ++++ 7 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/website.yml create mode 100644 .holo/branches/docs-site/_laddr.toml create mode 100644 .holo/branches/docs-site/_skeleton-v2.toml rename docs/{laddr => }/development/clone-from-git.md (100%) create mode 100644 mkdocs.site.yml diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..2b8ed6b0 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,18 @@ +name: Publish Website + +on: + push: + branches: [ develop ] + +jobs: + publish-website: + runs-on: ubuntu-latest + steps: + - name: 'Update holobranch: gh-pages' + uses: JarvusInnovations/hologit@actions/projector/v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HAB_LICENSE: accept + with: + holobranch: docs-site + commit-to: gh-pages diff --git a/.holo/branches/docs-site/_laddr.toml b/.holo/branches/docs-site/_laddr.toml new file mode 100644 index 00000000..ea92412d --- /dev/null +++ b/.holo/branches/docs-site/_laddr.toml @@ -0,0 +1,5 @@ +[holomapping] +files = [ + "docs/**", + "mkdocs.*.yml" +] diff --git a/.holo/branches/docs-site/_skeleton-v2.toml b/.holo/branches/docs-site/_skeleton-v2.toml new file mode 100644 index 00000000..5acc739a --- /dev/null +++ b/.holo/branches/docs-site/_skeleton-v2.toml @@ -0,0 +1,4 @@ +[holomapping] +holosource="=>docs-skeleton" +files = "**" +before = "*" diff --git a/.holo/branches/emergence-site/_skeleton-v2.toml b/.holo/branches/emergence-site/_skeleton-v2.toml index 828b8a0c..5a0ec4e6 100644 --- a/.holo/branches/emergence-site/_skeleton-v2.toml +++ b/.holo/branches/emergence-site/_skeleton-v2.toml @@ -1,4 +1,5 @@ [holomapping] +holosource="=>emergence-skeleton" files = [ "*/**", "!php-config/Git.config.d/" diff --git a/.holo/sources/skeleton-v2.toml b/.holo/sources/skeleton-v2.toml index e14284fc..e7634531 100644 --- a/.holo/sources/skeleton-v2.toml +++ b/.holo/sources/skeleton-v2.toml @@ -1,3 +1,3 @@ [holosource] url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" -ref = "refs/heads/emergence/skeleton/v2" +ref = "refs/tags/v2.5.2" diff --git a/docs/laddr/development/clone-from-git.md b/docs/development/clone-from-git.md similarity index 100% rename from docs/laddr/development/clone-from-git.md rename to docs/development/clone-from-git.md diff --git a/mkdocs.site.yml b/mkdocs.site.yml new file mode 100644 index 00000000..b8ef4b7a --- /dev/null +++ b/mkdocs.site.yml @@ -0,0 +1,4 @@ +site_name: laddr documentation +repo_url: https://github.com/CodeForPhilly/laddr +site_url: https://codeforphilly.github.io/laddr +edit_uri: edit/develop/docs From 63431f846b8446aee26703f2ff1985d58eefcbf9 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Sun, 31 Jan 2021 05:40:24 +0000 Subject: [PATCH 05/10] feat: add studio --- .holo/branches/emergence-site/_laddr.toml | 7 +- .studiorc | 19 ++++- script/-studio-bootstrap | 91 +++++++++++++++++++++++ script/studio | 67 +++++++++++++++++ 4 files changed, 181 insertions(+), 3 deletions(-) create mode 100755 script/-studio-bootstrap create mode 100755 script/studio diff --git a/.holo/branches/emergence-site/_laddr.toml b/.holo/branches/emergence-site/_laddr.toml index c9e7976a..c9709d44 100644 --- a/.holo/branches/emergence-site/_laddr.toml +++ b/.holo/branches/emergence-site/_laddr.toml @@ -1,7 +1,10 @@ [holomapping] files = [ "*/**", - "!.vscode/", - "!docs/" + "!.github/**", + "!.vscode/**", + "!cypress/**", + "!docs/**", + "!script/**", ] after = "*" diff --git a/.studiorc b/.studiorc index 66daba17..0935aa1a 100644 --- a/.studiorc +++ b/.studiorc @@ -1,3 +1,20 @@ #!/bin/bash -hab pkg install emergence/studio + +# install dependent studios +hab pkg install emergence/studio jarvus/mkdocs-studio + +# disable studios printing their own help +export STUDIO_NOHELP="yes" + source "$(hab pkg path emergence/studio)/studio.sh" + +export DOCS_HOLOBRANCH="docs-site" +source "$(hab pkg path jarvus/mkdocs-studio)/studio.sh" + + +## final init and output +studio-help + + +# final blank line +echo diff --git a/script/-studio-bootstrap b/script/-studio-bootstrap new file mode 100755 index 00000000..7f3c8ac5 --- /dev/null +++ b/script/-studio-bootstrap @@ -0,0 +1,91 @@ +#!/bin/bash + +# script/-studio-bootstrap: Check dependencies for Chef Habitat studio. + +set -e +cd "$(dirname "$0")/.." + + +echo +echo "==> studio-bootstrap: verifying Docker…" + +if ! [ -x "$(command -v docker)" ]; then + echo "Please install Docker Engine: https://docs.docker.com/engine/install/" + exit 1 +fi + +if ! docker info > /dev/null 2>&1; then + echo "Docker Engine is not running, or your user does not have access to connect." + echo "Try starting Docker Engine, and adding your user to the docker group: sudo gpasswd -a $USER docker" + exit 1 +fi + + +echo +echo "==> studio-bootstrap: verifying Chef Habitat…" + +if ! [ -x "$(command -v hab)" ]; then + echo "Please install Chef Habitat: https://www.habitat.sh/docs/install-habitat/" + exit 1 +fi + +set +e +hab_version="$(hab --version < /dev/null)" +if [ $? -ne 0 ]; then + echo + echo " Failed to read hab version, you may need to accept the Chef Habitat" + echo " license. Please run \`hab setup\` or configure HAB_LICENSE in the environment" + exit 1 +fi +set -e + +if ! [[ $hab_version =~ ^hab[[:space:]][0-9]+\.[0-9]+\.[0-9]+/[0-9]+$ ]]; then + echo + echo " Could not parse hab version: ${hab_version}" + echo " Please install hab 1.6+" + exit 1 +fi + +hab_version="$(echo "${hab_version}" | awk '{print $2}' | awk -F'/' '{print $1}')" +echo " Found hab version: ${hab_version}" + + +# check that node >= MAJOR.MINOR +hab_min_major="1" +hab_min_minor="6" + +IFS='.' read -ra hab_version_split <<< "${hab_version#v}" +if [ "${hab_version_split[0]}" -lt "${hab_min_major}" ] || [[ "${hab_version_split[0]}" -le "${hab_min_major}" && "${hab_version_split[1]}" -lt "${hab_min_minor}" ]]; then + echo + echo " Please install hab >= ${hab_min_major}.${hab_min_minor}.x" + exit 1 +fi + +if ! [ -f ~/.hab/etc/cli.toml ] || ! grep -q '^origin =' ~/.hab/etc/cli.toml; then + echo "Please re-run \`hab setup\` and choose to set a default origin, it can be anything" + exit 1 +fi + +_origin=$(awk -F'"' '/^origin = /{print $2}' ~/.hab/etc/cli.toml) + + +echo +echo "==> studio-bootstrap: verifying origin '${_origin}'…" + +_root_owned_key_count=$(ls -l ~/.hab/cache/keys | cut -f 3,4 -d " " | grep "root root" | wc -l) + +if [ "$_root_owned_key_count" -gt 0 ]; then + echo "Working around: https://github.com/habitat-sh/habitat/issues/7737" + echo "Found ${_root_owned_key_count} keys owned by root. Chowning them to $USER:$USER." + sudo chown $USER:$USER ~/.hab/cache/keys/* +fi + +if ! hab origin key export --type secret "${_origin}" > /dev/null; then + echo "No key has been generated for origin ${_origin}, run: hab origin key generate ${_origin}" + exit 1 +fi + + +echo +echo "==> studio-bootstrap: all set 👍" +echo diff --git a/script/studio b/script/studio new file mode 100755 index 00000000..3d98d742 --- /dev/null +++ b/script/studio @@ -0,0 +1,67 @@ +#!/bin/sh + +# script/studio: Enter a Chef Habitat studio for the application. + +set -e +cd "$(dirname "$0")/.." + + +script/-studio-bootstrap + + +unset DEBUG +[ -n "${1}" ] && cd "${1}" + + +echo +echo "==> studio: configuring Chef Habitat studio Docker options…" +STUDIO_NAME="${STUDIO_NAME:-laddr-studio}" +export HAB_DOCKER_OPTS=" + --name ${STUDIO_NAME} + -p 9070:80 + -p 9078:8000 + -p 9076:3306 + -v $(cd ~/.ssh; pwd)/known_hosts:/root/.ssh/known_hosts:ro + --env STUDIO_DEVELOPER_UID=$(id -u) + --env STUDIO_DEVELOPER_GID=$(id -g) +" +echo "${HAB_DOCKER_OPTS}" + + +launch_studio=true +if [ "$(docker ps -aq -f name="${STUDIO_NAME}")" ]; then + echo + echo "==> studio: a ${STUDIO_NAME} container is already running…" + echo + while true; do + read -p "==> studio: would you like to (A)ttach to it, (s)top it, or do (n)othing? [A/s/n] " choice + case "${choice}" in + r|R|a|A|"") + echo + echo "==> studio: you can run studio-help at anytime to get a list of commands" + echo + docker attach "${STUDIO_NAME}" + launch_studio=false + break;; + s|S) + echo "==> studio: stopping existing container…" + docker stop "${STUDIO_NAME}" > /dev/null + break;; + n|N) + echo "==> studio: doing nothing with existing container… an error is likely to occur" + break ;; + *) + echo "==> studio: $choice is invalid";; + esac + done +fi + +if [ $launch_studio = true ]; then + echo + echo "==> studio: launching Docker-powered Chef Habitat studio…" + set +e + if ! hab studio enter -D; then + echo "===> studio: failed to launch studio… try executing the following and try again:" + echo "docker rm -f ${STUDIO_NAME}" + fi +fi From 739ffdbe728f7e398395e88d3c59f271d0fce8f2 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 17 Aug 2021 17:21:14 -0400 Subject: [PATCH 06/10] chore(deps): bump skeleton-v2 to v2.6.11 --- .holo/sources/skeleton-v2.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.holo/sources/skeleton-v2.toml b/.holo/sources/skeleton-v2.toml index e7634531..3fb2e70c 100644 --- a/.holo/sources/skeleton-v2.toml +++ b/.holo/sources/skeleton-v2.toml @@ -1,3 +1,3 @@ [holosource] url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" -ref = "refs/tags/v2.5.2" +ref = "refs/tags/v2.6.11" From d6c92aee7b79e640269940f4aef74b66b4325561 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Wed, 25 Aug 2021 02:12:35 +0000 Subject: [PATCH 07/10] refactor(ci): update gh workflow naming/format --- .../workflows/{website.yml => publish-docs.yml} | 6 ++++-- .../{holo.yml => publish-holobranches.yml} | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) rename .github/workflows/{website.yml => publish-docs.yml} (89%) rename .github/workflows/{holo.yml => publish-holobranches.yml} (91%) diff --git a/.github/workflows/website.yml b/.github/workflows/publish-docs.yml similarity index 89% rename from .github/workflows/website.yml rename to .github/workflows/publish-docs.yml index 2b8ed6b0..6f34c4ad 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/publish-docs.yml @@ -1,13 +1,15 @@ -name: Publish Website +name: Publish Docs on: push: branches: [ develop ] jobs: - publish-website: + + publish-docs: runs-on: ubuntu-latest steps: + - name: 'Update holobranch: gh-pages' uses: JarvusInnovations/hologit@actions/projector/v1 env: diff --git a/.github/workflows/holo.yml b/.github/workflows/publish-holobranches.yml similarity index 91% rename from .github/workflows/holo.yml rename to .github/workflows/publish-holobranches.yml index e25622fd..6aef41d5 100644 --- a/.github/workflows/holo.yml +++ b/.github/workflows/publish-holobranches.yml @@ -1,33 +1,33 @@ -name: Projections +name: Publish Holobranches on: push: - tags: - - 'v3.*' - + tags: [ 'v3.*' ] jobs: - holobranch-projections: + + publish-holobranches: runs-on: ubuntu-latest steps: + - name: 'Update holobranch: emergence/skeleton/v3' uses: JarvusInnovations/hologit@actions/projector/v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HAB_LICENSE: accept with: - ref: releases/v3 holobranch: emergence-skeleton commit-to: emergence/skeleton/v3 + - name: 'Update holobranch: emergence/vfs-site/v3' uses: JarvusInnovations/hologit@actions/projector/v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HAB_LICENSE: accept with: - ref: releases/v3 holobranch: emergence-vfs-site commit-to: emergence/vfs-site/v3 + - name: 'Update v3.laddr.us' env: VFS_DEV_TOKEN: ${{ secrets.VFS_DEV_TOKEN }} From b024a4ed7abef28c84a005aca314bd18cf55ddfd Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Wed, 25 Aug 2021 02:24:05 +0000 Subject: [PATCH 08/10] chore(deps): bump skeleton-v2 to v2.6.12 --- .holo/sources/skeleton-v2.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.holo/sources/skeleton-v2.toml b/.holo/sources/skeleton-v2.toml index 3fb2e70c..1b8c74eb 100644 --- a/.holo/sources/skeleton-v2.toml +++ b/.holo/sources/skeleton-v2.toml @@ -1,3 +1,3 @@ [holosource] url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" -ref = "refs/tags/v2.6.11" +ref = "refs/tags/v2.6.12" From a3b0230bba6032c324b57b464a5308effa51377c Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Wed, 25 Aug 2021 02:24:13 +0000 Subject: [PATCH 09/10] chore(ci): update mapping format --- .holo/branches/emergence-site/_laddr.toml | 16 +++++++++++----- .holo/branches/emergence-site/_skeleton-v2.toml | 5 +---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.holo/branches/emergence-site/_laddr.toml b/.holo/branches/emergence-site/_laddr.toml index c9709d44..83b46b6b 100644 --- a/.holo/branches/emergence-site/_laddr.toml +++ b/.holo/branches/emergence-site/_laddr.toml @@ -1,10 +1,16 @@ [holomapping] files = [ "*/**", - "!.github/**", - "!.vscode/**", - "!cypress/**", - "!docs/**", - "!script/**", + + # exclude CI and developer assets + "!.github/", + "!.vscode/", + "!cypress/", + "!docs/", + "!fixtures/", + "!habitat/", + "!helm-chart/", + "!php-config/Git.config.d/", + "!script/", ] after = "*" diff --git a/.holo/branches/emergence-site/_skeleton-v2.toml b/.holo/branches/emergence-site/_skeleton-v2.toml index 5a0ec4e6..bbf2baa5 100644 --- a/.holo/branches/emergence-site/_skeleton-v2.toml +++ b/.holo/branches/emergence-site/_skeleton-v2.toml @@ -1,7 +1,4 @@ [holomapping] holosource="=>emergence-skeleton" -files = [ - "*/**", - "!php-config/Git.config.d/" -] +files = "**" before = "*" From 181d2ac135a47c95c19811448dd540f49bf8a95b Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Wed, 25 Aug 2021 02:26:10 +0000 Subject: [PATCH 10/10] feat(ci): add GitHub release workflows --- .github/workflows/release-deploy.yml | 43 ++++++++++ .github/workflows/release-prepare.yml | 113 +++++++++++++++++++++++++ .github/workflows/release-validate.yml | 34 ++++++++ 3 files changed, 190 insertions(+) create mode 100644 .github/workflows/release-deploy.yml create mode 100644 .github/workflows/release-prepare.yml create mode 100644 .github/workflows/release-validate.yml diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml new file mode 100644 index 00000000..c4d98477 --- /dev/null +++ b/.github/workflows/release-deploy.yml @@ -0,0 +1,43 @@ +name: 'Release: Deploy PR' + +on: + pull_request: + branches: [ 'releases/v*' ] + types: [ closed ] + +jobs: + release-deploy: + + if: github.event.pull_request.merged == true # only run on PR merge + runs-on: ubuntu-latest + steps: + + - name: Configure release + run: | + PR_TITLE=$(jq -r ".pull_request.title" $GITHUB_EVENT_PATH) + PR_BODY=$(jq -r ".pull_request.body" $GITHUB_EVENT_PATH) + RELEASE_TAG=$(echo "${PR_TITLE}" | grep -oP "(?<=^Release: )v\d+\.\d+\.\d+(-rc\.\d+)?$") + + if [[ "${RELEASE_TAG}" =~ -rc\.[0-9]+$ ]]; then + RELEASE_PRERELEASE=true + else + RELEASE_PRERELEASE=false + fi + + echo "PR_TITLE=${PR_TITLE}" >> $GITHUB_ENV + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV + echo "RELEASE_PRERELEASE=${RELEASE_PRERELEASE}" >> $GITHUB_ENV + + echo 'PR_BODY<> $GITHUB_ENV + echo "${PR_BODY}" >> $GITHUB_ENV + echo 'END_OF_PR_BODY' >> $GITHUB_ENV + + - name: Create release + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.BOT_GITHUB_TOKEN }} + commit: '${{ github.sha }}' + tag: '${{ env.RELEASE_TAG }}' + body: '${{ env.PR_BODY }}' + draft: false + prerelease: ${{ env.RELEASE_PRERELEASE }} diff --git a/.github/workflows/release-prepare.yml b/.github/workflows/release-prepare.yml new file mode 100644 index 00000000..4a09e3fb --- /dev/null +++ b/.github/workflows/release-prepare.yml @@ -0,0 +1,113 @@ +name: 'Release: Prepare PR' + +on: + push: + branches: [ develop ] + +env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + RELEASE_BRANCH: releases/v3 + +jobs: + release-prepare: + + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # - uses: mxschmitt/action-tmate@v3 + + - name: Create/update pull request + run: | + # get latest release tag + latest_release=$(git describe --tags --abbrev=0 "origin/${RELEASE_BRANCH}") + latest_release_bumped=$(echo $latest_release | awk -F. -v OFS=. '{$NF++;print}') + + + # create or update PR + pr_body="$(cat < /tmp/pr.json + pr_number=$(hub pr list -h develop -f '%I') + echo "Opened PR #${pr_number}" + fi + + + # build changelog + commits=$( + git log \ + --first-parent \ + --reverse \ + --format="%H" \ + "origin/${RELEASE_BRANCH}..develop" + ) + + changelog=() + + while read -r commit; do + subject="$(git show -s --format=%s "${commit}")" + line="" + + if [[ "${subject}" =~ Merge\ pull\ request\ \#([0-9]+) ]]; then + line="$(hub pr show -f '%t [%i] @%au' "${BASH_REMATCH[1]}" || true)" + fi + + if [ -z "${line}" ]; then + author="$(hub api "/repos/${GITHUB_REPOSITORY}/commits/${commit}" -H Accept:application/vnd.github.v3+json | jq -r '.author.login')" + if [ -n "${author}" ]; then + author="@${author}" + else + author="$(git show -s --format=%ae "${commit}")" + fi + + line="${subject} ${author}" + fi + + # move ticket number prefix into to existing square brackets at end + line="$(echo "${line}" | perl -pe 's/^([A-Z]+-[0-9]+):?\s*(.*?)\s*\[([^]]+)\]\s*(\S+)$/\2 [\3, \1] \4/')" + + # move ticket number prefix into to new square brackets at end + line="$(echo "${line}" | perl -pe 's/^([A-Z]+-[0-9]+):?\s*(.*?)\s*(\S+)$/\2 [\1] \3/')" + + # combine doubled square brackets at the end + line="$(echo "${line}" | perl -pe 's/^\s*(.*?)\s*\[([A-Z]+-[0-9]+)\]\s*\[([^]]+)\]\s*(\S+)$/\1 [\3, \2] \4/')" + + changelog+=("- ${line}") + done <<< "${commits}" + + + # create or update comment + comment_body="$(cat <> $GITHUB_ENV + else + echo 'PR title must match format "Release: vX.Y.Z(-rc.#)?"' + exit 1 + fi + + # check that tag doesn't exist + if git ls-remote --exit-code "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}" "refs/tags/${RELEASE_TAG}"; then + echo "The PR title's version exists already" + exit 1 + fi