Skip to content

Set FLAG_HARDWARE_ACCELERATED in ShadowPackageManger.addActivityIfNotPresent #1577

Set FLAG_HARDWARE_ACCELERATED in ShadowPackageManger.addActivityIfNotPresent

Set FLAG_HARDWARE_ACCELERATED in ShadowPackageManger.addActivityIfNotPresent #1577

name: Validate commit message
on:
pull_request:
branches: [ master, google ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate_commit_message:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Validate commit title
run: |
# Check that the commit title isn't excessively long.
commit_title="$(git log -1 --pretty=format:'%s')"
if [ "${#commit_title}" -gt 120 ]; then
echo "Error: the title of the commit is too long (max: 120 characters)"
exit 1
fi
lowercase_title="$(echo $commit_title | awk '{print tolower($0)}')"
# Check that the commit title isn't 'internal' (ignore case)
if [ "$lowercase_title" = "internal" ]; then
echo "Error: '$commit_title' is not a valid commit title"
exit 1
fi
- name: Validate commit body
run: |
# Check that the commit has a body
commit_body="$(git log -1 --pretty=format:'%b' | grep -v 'PiperOrigin-RevId')"
if [ -z "$commit_body" ]; then
echo "Error: the commit should have a descriptive body"
exit 1
fi
while read -r line; do
if [ "${#line}" -gt 120 ] && [[ ! "$line" =~ (https?://|www\.) ]]; then
echo "Error: the following line of the commit body is too long (max: 120 characters):"
echo "> $line"
exit 1
fi
done <<< $commit_body