-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ConformanceTestFix-1
- Loading branch information
Showing
13 changed files
with
220 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,34 @@ jobs: | |
if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport')) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GH CLI | ||
uses: dev-hanz-ops/[email protected] | ||
|
||
- name: Fetch PR description and update backportrc | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
REPO: ${{ github.repository }} | ||
run: | | ||
# Grab raw original PR body, gh CLI uses the default token. | ||
BODY_CONTENT="$(gh api "/repos/$REPO/pulls/$PR_NUMBER" | jq -r .body)" | ||
# Escape the markdown content so that sed can produce valid JSON. | ||
# Remove starting and ending quites and replace new lines with literals. | ||
ESCAPED_CONTENT=$(echo "$BODY_CONTENT" | jq -aRs .) | ||
ESCAPED_CONTENT="${ESCAPED_CONTENT%\"}" | ||
ESCAPED_CONTENT="${ESCAPED_CONTENT#\"}" | ||
ESCAPED_CONTENT=$(echo "$ESCAPED_CONTENT" | sed 's/[\/&]/\\&/g') | ||
# sourcePullRequest is an actual variable, but the PR description is not provided by the action or the CLI. | ||
# Instead we are using it as a substitution target and replacing it with the markdown content. | ||
sed -i "s/{{sourcePullRequest}}/$ESCAPED_CONTENT/g" .backportrc.json | ||
- name: Backport Action | ||
uses: sorenlouv/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.