Skip to content

Create alloc_test.yml #1300

Create alloc_test.yml

Create alloc_test.yml #1300

name: Test 2
on:
workflow_dispatch:
inputs:
body:
description: ""
default: ""
required: false
test:
description: ""
default: "false"
required: false
pull_request_target:
jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: replacement
run: |
VARIABLE=my-repo-test
echo "${VARIABLE//-/_}"
DB_NAME=$GITHUB_REPOSITORY
TEST="${DB_NAME//-/_}"
echo $TEST
check-body-length:
runs-on: ubuntu-latest
steps:
- name: check
env:
PRNUM: ${{ github.event.pull_request.number }}
PRBODY: ${{ github.event.pull_request.body }}
TESTBODY: ${{ github.event.inputs.body }}
TEST: ${{ github.event.inputs.test }}
run: |
if [ "$TEST" = "true" ]
then
PRBODY=$TESTBODY
fi
commentPR () {
if [ "$TEST" = "true" ]
then
echo "would comment: '${1}'"
else
gh pr comment $PRNUM -b "${1}"
fi
}
if [ "$PRBODY" = "" ]
then
commentPR "Thanks! Please add a body so we can better review your contribution."
fi