Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/prove-dispatch-works.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# A basic workflow to dispatch another workflow
name: Dispatch Workflow

# Controls when the action will run.
# This workflow now runs on pushes AND pull requests
on: [pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "print"
print:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# This block grants the GITHUB_TOKEN the permission
# to trigger other workflows.
permissions:
actions: write

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# This step checks out a copy of your repository
# so that git and gh commands have context.
- name: Checkout repository
uses: actions/checkout@v4

- name: Trigger the vulnerable workflow dispatch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# We'll use a simple string for this test
test_str='Hello from the trigger workflow!'
echo "Triggering CTF workflow with payload: $test_str"
# Use double quotes to ensure the variable expands correctly.
gh workflow run workflow-dispatch.yaml --ref ${{ github.event.pull_request.head.ref }} -f message="$test_str"