-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
Hi,
I'm trying to implement a custom workflow which runs on the branch of the PR where the command was triggered.
My trigger looks like this:
name: Dispatcher
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request }}
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.REPO_PAT }}
allow-edits: true
reaction-token: ${{ secrets.REPO_PAT }}
permission: write
dispatch-type: workflow
ref: ${{ env.GITHUB_REF }}
commands: |
test
If I write /test
in my PR it'll trigger the dispatcher and also the action which listens on the Event but it will alway use the main branch. Is there a way to use the PR branch? As you can see I tried using the ref
argument but thats not recognized.
My custom action to be triggered looks like this:
name: Testing
on:
workflow_dispatch:
jobs:
jest:
name: Run Jest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
I verfied that the commit hash was wrong in the GitHub UI:
This commit is from the main branch and not from my PR:
Expected behaviour would be, that it checks out the branch which is associated with the Pull Request where I typed the command. Is this even possible?
Metadata
Metadata
Assignees
Labels
No labels