Update automerge.yaml
Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
@@ -11,15 +11,31 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- name: Debug Event Payload
|
||||
run: cat "$GITHUB_EVENT_PATH"
|
||||
|
||||
- name: Check for automerge label
|
||||
id: check-label
|
||||
run: |
|
||||
echo "Checking for 'automerge' label..."
|
||||
if [[ "$(jq -r '.pull_request.labels | map(.name) | join(",")' "$GITHUB_EVENT_PATH")" != *"automerge"* ]]; then
|
||||
pull_request_labels=$(jq -r '.workflow_run.pull_requests[0].labels // empty' "$GITHUB_EVENT_PATH")
|
||||
if [ -z "$pull_request_labels" ]; then
|
||||
echo "No labels found in the pull request. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(echo "$pull_request_labels" | jq -r 'map(.name) | join(",")')" != *"automerge"* ]]; then
|
||||
echo "The 'automerge' label is not present. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
commit_message=$(jq -r '.workflow_run.head_commit.message // empty' "$GITHUB_EVENT_PATH")
|
||||
if [ -z "$commit_message" ]; then
|
||||
echo "No commit message found. Exiting."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
approve:
|
||||
needs: check-automerge-label
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user