17
examples/assignees-example.yml
Normal file
17
examples/assignees-example.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Pull Request on Branch Push
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- devel
|
||||||
|
jobs:
|
||||||
|
auto-pull-request:
|
||||||
|
name: PullRequestAction
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: pull-request-action
|
||||||
|
uses: vsoch/pull-request-action@add/assignees
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
BRANCH_PREFIX: "update/"
|
||||||
|
PULL_REQUEST_BRANCH: "master"
|
||||||
|
PULL_REQUEST_ASSIGNEES: vsoch
|
||||||
@@ -37,7 +37,7 @@ check_events_json() {
|
|||||||
|
|
||||||
if [[ ! -f "${GITHUB_EVENT_PATH}" ]]; then
|
if [[ ! -f "${GITHUB_EVENT_PATH}" ]]; then
|
||||||
printf "Cannot find Github events file at ${GITHUB_EVENT_PATH}\n";
|
printf "Cannot find Github events file at ${GITHUB_EVENT_PATH}\n";
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
printf "Found ${GITHUB_EVENT_PATH}\n";
|
printf "Found ${GITHUB_EVENT_PATH}\n";
|
||||||
|
|
||||||
@@ -80,9 +80,8 @@ create_pull_request() {
|
|||||||
NUMBER=$(echo "${RESPONSE}" | jq --raw-output '.number')
|
NUMBER=$(echo "${RESPONSE}" | jq --raw-output '.number')
|
||||||
printf "Number opened for PR is ${NUMBER}\n"
|
printf "Number opened for PR is ${NUMBER}\n"
|
||||||
|
|
||||||
# Remove trailing slashes
|
# Remove leading and trailing quotes
|
||||||
ASSIGNEES="${ASSIGNEES%\"}"
|
ASSIGNEES=$(echo "$ASSIGNEES" | sed -e 's/^"//' -e 's/"$//')
|
||||||
ASSIGNEES="${ASSIGNEES#\"}"
|
|
||||||
|
|
||||||
# Parse assignees into a list
|
# Parse assignees into a list
|
||||||
ASSIGNEES=$(echo $ASSIGNEES | sed -e 's/\(\w*\)/,"\1"/g' | cut -d , -f 2-)
|
ASSIGNEES=$(echo $ASSIGNEES | sed -e 's/\(\w*\)/,"\1"/g' | cut -d , -f 2-)
|
||||||
@@ -94,7 +93,6 @@ create_pull_request() {
|
|||||||
ASSIGNEES_URL="${ISSUE_URL}/${NUMBER}/assignees"
|
ASSIGNEES_URL="${ISSUE_URL}/${NUMBER}/assignees"
|
||||||
curl -sSL -H "${AUTH_HEADER}" -H "${HEADER}" --user "${GITHUB_ACTOR}" -X POST --data "${DATA}" ${ASSIGNEES_URL}
|
curl -sSL -H "${AUTH_HEADER}" -H "${HEADER}" --user "${GITHUB_ACTOR}" -X POST --data "${DATA}" ${ASSIGNEES_URL}
|
||||||
printf "$?\n"
|
printf "$?\n"
|
||||||
exit 1;
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user