diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 427d86e..fc3afe2 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,31 +1,24 @@ -name: Pull Request +name: Trigger Workflow in Repo steven-rhodes1 on: pull_request: - branches: - - main + types: [opened, synchronize, reopened] jobs: - hello_world: + trigger: runs-on: ubuntu-latest - steps: - - name: Get Source Branch - run: echo "branch=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ env.branch }} - fetch-depth: 0 - - - name: Identify Changed Directories - id: identify_directory - run: | - cdir=$( git diff --name-only r HEAD^1 HEAD | perl -ne 'print "$1\n" if(/(.*)\/.*/)' | grep -v github | sort |uniq|xargs| perl -ne 'chom; @a=split(/ /,$_); print "[\"" . join("\",\"", @a). "\"];' ) - echo "Changed directories: $cdir" - echo "cdir=$cdir >> $GITHUB_OUTPUT" - - outputs: - changed_dirs: ${{ steps.identify_directory.outputs.cdir }} - + - name: Trigger Workflow in Repository A + uses: actions/github-script@v6 + with: + github-token: ${{secrets.STEVEN_RHODES1_TOKEN}} + script: | + github.actions.createWorkflowDispatch({ + owner: 'steven-rhodes1', + repo: 'sandbox', + workflow_id: 'pull-request-workflow.yml', + ref: 'main', + inputs: { + pr_number: 'PR is ${{ github.event.pull_request.number }}' + } + }) diff --git a/README.md b/README.md index 00bcb6e..3a772ca 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# test \ No newline at end of file +# test +this \ No newline at end of file diff --git a/that.txt b/that.txt new file mode 100644 index 0000000..949c08d --- /dev/null +++ b/that.txt @@ -0,0 +1,2 @@ +this +something \ No newline at end of file