Skip to content
Open
Show file tree
Hide file tree
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
41 changes: 17 additions & 24 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -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 }}'
}
})
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# test
# test
this
2 changes: 2 additions & 0 deletions that.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
this
something