-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"ignorePatterns": [ | ||
{ | ||
"pattern": "^http://localhost" | ||
} | ||
], | ||
"aliveStatusCodes": [ | ||
200, | ||
203, | ||
206 | ||
], | ||
"_retryComment": "enable retry on 429, this seems to be happening with GitHub links sometimes.", | ||
"retryOn429": true, | ||
"retryCount": 2, | ||
"_fallbackRetryDelayComment": "The `fallbackRetryDelay` is only used when the `retry-after` header of the response has an invalid value. See https://github.com/tcort/markdown-link-check#config-file-format for more info", | ||
"fallbackRetryDelay": "60s" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
// disable line length limitations for existing documentation | ||
"MD013": false, | ||
// allow same headings | ||
"MD024": false, | ||
// allow inline html | ||
"MD033": false, | ||
//ignore first line headers | ||
"MD041": false, | ||
// code block style | ||
"MD046": false | ||
} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT license. | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -e | ||
cd "$(dirname "$0")/.." | ||
|
||
if ! command -v gh &> /dev/null | ||
then | ||
echo "GitHub CLI not found. Please install before running the script." | ||
exit | ||
fi | ||
|
||
if [ -z "$GITHUB_PAT_TOKEN" ] | ||
then | ||
echo "Missing \$GITHUB_PAT_TOKEN environment variable. Please set it before running the script." | ||
exit | ||
fi | ||
|
||
if ! command -v cargo-about &> /dev/null | ||
then | ||
echo "Cargo-about could not be found. Installing now" | ||
cargo install --locked cargo-about | ||
fi | ||
|
||
PR_TITLE="chore: Notice file change" | ||
if [ "$(gh pr list --search "$PR_TITLE" --json number | jq '. | length')" -gt 0 ] | ||
then | ||
echo>&2 "A PR is already there for a NOTICE file change. Please merge it or cancel it to have this pipeline properly running." | ||
exit 1 | ||
fi | ||
|
||
NOTICE_FILENAME="NOTICE" | ||
echo "Running cargo-about for NOTICE file generation..." | ||
cargo about generate --workspace devops/cg/about.hbs --config devops/cg/about.toml | sed -E 's/[ \t]+\r?$//' > $NOTICE_FILENAME | ||
|
||
if [ -z "$(git diff --name-only $NOTICE_FILENAME)" ] | ||
then | ||
echo "File not changed" | ||
else | ||
echo "File changed. Checking out a new branch and creating a PR" | ||
BRANCH_NAME="fix/notice-file-update-$(date +%s)" | ||
git checkout -b "$BRANCH_NAME" | ||
git add $NOTICE_FILENAME | ||
git commit -m "New notice file" | ||
git push -f --set-upstream origin "$BRANCH_NAME" | ||
## token needs repo access and read:org | ||
echo "$GITHUB_PAT_TOKEN" | gh auth login --with-token | ||
gh pr create -B main -H "$BRANCH_NAME" --title "$PR_TITLE" --body 'This PR is merging latest changes related to notice file. Please review them before approving.' | ||
fi |