Skip to content
Merged
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
16 changes: 15 additions & 1 deletion .github/workflows/branch-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,23 @@ jobs:
exit 0
fi

# GitHub or Dependabot may have deleted the branch already. Only an
# existing branch is deleted; a lookup error still fails the job.
if git ls-remote --exit-code --heads origin "refs/heads/$BRANCH_NAME" >/dev/null; then
:
else
status=$?
if [[ $status == 2 ]]; then
echo "::notice::Branch is already deleted: $BRANCH_NAME"
exit 0
fi
echo "::error::Could not look up branch: $BRANCH_NAME"
exit 1
fi

# Attempt branch deletion. Quotes prevent injection.
echo "Attempting to delete branch: $BRANCH_NAME"
if git push origin --delete "$BRANCH_NAME" 2>/dev/null; then
if git push origin --delete "$BRANCH_NAME"; then
echo "::notice::Successfully deleted branch: $BRANCH_NAME"
else
echo "::error::Failed to delete branch: $BRANCH_NAME"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/wp-compatibility-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ jobs:
<rule ref="WordPressVIPMinimum.Security"/>
<rule ref="WordPressVIPMinimum.Performance"/>
<rule ref="WordPressVIPMinimum.UserExperience"/>
<rule ref="WordPressVIPMinimum.Functions"/>
<rule ref="WordPressVIPMinimum.Functions.CheckReturnValue"/>
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions"/>
<rule ref="WordPressVIPMinimum.Functions.StripTags"/>
<rule ref="WordPressVIPMinimum.Variables"/>
<rule ref="WordPressVIPMinimum.Files"/>
<rule ref="WordPressVIPMinimum.Hooks"/>
Expand Down
Loading