Skip to content

Commit

Permalink
Triggering only when pipeline:run is commented
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Aug 29, 2024
1 parent a679f87 commit 708afac
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/rit.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Rootstock Integration Tests

on:
push:
branches:
- "master"
- "*-rc"
# push:
# branches:
# - "master"
# - "*-rc"
pull_request:
types: [opened, reopened, synchronize]
branches:
Expand Down Expand Up @@ -63,11 +63,18 @@ jobs:
ref: ${{ env.RIT_BRANCH }}
fetch-depth: 0

- name: Debug Comment Event
if: github.event_name == 'issue_comment'
run: |
echo "Comment body: ${{ github.event.comment.body }}"
- name: Check Comment Condition
if: github.event_name == 'issue_comment'
run: |
echo "Evaluating condition..."
if [[ "${{ github.event_name }}" == "issue_comment" && "${{ github.event.comment.body }}" == *"/pipeline:run"* ]]; then
if [[ "${{ github.event.comment.body }}" == *"/pipeline:run"* ]]; then
echo "Condition met: Pipeline run command detected in comment."
echo "Triggering pipeline..."
else
echo "Condition not met: Comment body is '${{ github.event.comment.body }}'"
fi
Expand Down

0 comments on commit 708afac

Please sign in to comment.