diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 153bba7116c..b618614f3a3 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -1,10 +1,10 @@ name: Rootstock Integration Tests on: - push: - branches: - - "master" - - "*-rc" + # push: + # branches: + # - "master" + # - "*-rc" pull_request: types: [opened, reopened, synchronize] branches: @@ -13,6 +13,10 @@ on: types: - created - edited +permissions: + contents: write + issues: write + jobs: rootstock-integration-tests: @@ -56,6 +60,12 @@ 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: @@ -63,17 +73,23 @@ 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." else echo "Condition not met: Comment body is '${{ github.event.comment.body }}'" fi - name: Run Rootstock Integration Tests - if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/pipeline:run')) + if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '/pipeline:run') uses: rsksmart/rootstock-integration-tests@v1 with: rskj-branch: ${{ env.RSKJ_BRANCH }}