diff --git a/.github/workflows/prove-dispatch-works.yaml b/.github/workflows/prove-dispatch-works.yaml new file mode 100644 index 0000000..b134f92 --- /dev/null +++ b/.github/workflows/prove-dispatch-works.yaml @@ -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" \ No newline at end of file