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 5c51bd8
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 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 All @@ -13,13 +13,23 @@ on:
types:
- created
- edited
permissions:
contents: write
issues: write
pull-requests: write


jobs:
rootstock-integration-tests:
name: Rootstock Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Debug Event
run: |
echo "Event Name: ${{ github.event_name }}"
echo "Event Payload: ${{ toJson(github.event) }}"
- name: Checkout rskj Repository
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
Expand Down Expand Up @@ -56,14 +66,26 @@ jobs:
echo "FED Branch: $(jq -r '.fed_branch' debug-values.json)"
echo "RIT Branch: $(jq -r '.rit_branch' debug-values.json)"
- name: Test Token Permissions
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user
- name: Checkout Rootstock Integration Tests Repository
uses: actions/checkout@v4
with:
repository: rsksmart/rootstock-integration-tests
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
Expand Down

0 comments on commit 5c51bd8

Please sign in to comment.