Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/check-draftlog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
exit 1
fi

INVALID_NAMES=$(echo "$ADDED" | grep -vE '^draftlogs/[0-9]+_(fix|add|remove|change|deprecate)\.md$' || true)
INVALID_NAMES=$(echo "$ADDED" | grep -vE "^draftlogs/${PR_NUMBER}_(fix|add|remove|change|deprecate)\.md$" || true)
if [ -n "$INVALID_NAMES" ]; then
echo "::error::Invalid draftlog filename(s):"
echo "$INVALID_NAMES" | sed 's/^/ - /'
echo ""
echo "Expected pattern: draftlogs/<number>_(fix|add|remove|change|deprecate).md"
echo "Expected pattern: draftlogs/${PR_NUMBER}_(fix|add|remove|change|deprecate).md"
echo "See draftlogs/README.md for details."
exit 1
fi
Expand All @@ -67,17 +67,17 @@ jobs:
while IFS= read -r f; do
[ -z "$f" ] && continue
content=$(gh api -H 'Accept: application/vnd.github.raw' "/repos/$REPO/contents/$f?ref=$HEAD_SHA")
if ! echo "$content" | grep -qE '\[\[#[0-9]+\]\(https://github\.com/plotly/plotly\.js/pull/[0-9]+\)\]'; then
if ! echo "$content" | grep -qE "\[\[#${PR_NUMBER}\]\(https://github\.com/plotly/plotly\.js/(pull|issues)/${PR_NUMBER}\)\]"; then
MISSING_LINK="$MISSING_LINK$f"$'\n'
fi
done <<< "$ADDED"

if [ -n "$MISSING_LINK" ]; then
echo "::error::Draftlog entry(ies) missing a PR link:"
echo "::error::Draftlog entry(ies) missing a link to this PR (#${PR_NUMBER}):"
printf '%s' "$MISSING_LINK" | sed 's/^/ - /'
echo ""
echo "Each entry must include a link in the form:"
echo " [[#1234](https://github.com/plotly/plotly.js/pull/1234)]"
echo " [[#${PR_NUMBER}](https://github.com/plotly/plotly.js/pull/${PR_NUMBER})]"
echo "See draftlogs/README.md for an example."
exit 1
fi
Expand Down
6 changes: 4 additions & 2 deletions draftlogs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Directory of draft logs to help prepare the upcoming [CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)

Every pull request should add at least one markdown file to this directory.
The filename must start with a number, preferably the PR number, followed by one of these:
The filename must start with the PR number, followed by one of these:
1. `_fix.md` to propose a bug fix
2. `_add.md` to propose new features
3. `_remove.md` to propose a feature removal
Expand All @@ -21,9 +21,11 @@ which would render

> Please start your single-line or multiple lined message with a verb.

Each entry must include a link back to the PR in the form shown above:
Each entry must include a link back to its own PR in the form shown above:
`[[#1234](https://github.com/plotly/plotly.js/pull/1234)]` (a link to
`/issues/1234` is also accepted, since GitHub redirects between the two).
The number in the filename, the `#1234` label, and the URL must all be the
same PR number.

### Skipping the draftlog

Expand Down
Loading