Skip to content

Commit

Permalink
Update the PR description for auto webassets udpates (#10212)
Browse files Browse the repository at this point in the history
The script for updating webassets uses the commit message from
webapps as the commit message for the PR to teleport.

This commit message is almost always a merged PR, which has the format:

    do some awesome thing (#123)

Where '#123' is the number of the **webapps** PR that was merged.

The problem with this is, when the teleport PR is created, it interprets
the #123 as the number of a **teleport** PR. And since the Teleport repo
has a lot more issues/PRs than webapps, Github ends up linking to an old
and completely unrelated PR.

Fix this by replacing (#123) with (gravitational/webapps#123), which
Github correctly renders as a link to the webapps PR in question.
  • Loading branch information
zmb3 authored Feb 8, 2022
1 parent e00ff42 commit b2ffe8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.assets/webapps/update-teleport-webassets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ git submodule update --init --recursive
# set variables based on context from webapps checkout
BRANCH=$(git rev-parse --abbrev-ref HEAD)
COMMIT=$(git rev-parse --short HEAD)
COMMIT_DESC=$(git log --decorate=off --oneline -1)
# use the commit message from webapps, qualifying references to webapps PRs to that they
# link to the correct PR from the teleport repo (#123 becomes gravitational/webapps#123)
COMMIT_DESC=$(git log --decorate=off --oneline -1 | sed -E 's.(#[0-9]+).gravitational/webapps\1.g')
COMMIT_URL="https://github.com/gravitational/webapps/commit/${COMMIT}"
AUTO_BRANCH_NAME="webapps-auto-pr-$(date +%s)"

Expand Down

0 comments on commit b2ffe8c

Please sign in to comment.