From 0cb0320dbbba241f2543e619561ace662d25c51e Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Fri, 12 Apr 2024 09:52:41 -0400 Subject: [PATCH 1/6] test1 --- that.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 that.txt diff --git a/that.txt b/that.txt new file mode 100644 index 0000000..9ecf3cf --- /dev/null +++ b/that.txt @@ -0,0 +1 @@ +this From 6223217c08dbbe97f7cdd1b7da02e5d1f8f63d07 Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Tue, 16 Apr 2024 20:09:10 -0400 Subject: [PATCH 2/6] config remote workflow --- .github/workflows/pull-request.yaml | 41 ++++++++++++----------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 427d86e..54f81f9 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.GITHUB_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 }}' + } + }) From 3c25d20a697608ebef328a523a1599b3fe947a3c Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Tue, 16 Apr 2024 20:28:34 -0400 Subject: [PATCH 3/6] Add remote triggered workflow --- .github/workflows/build.yaml | 28 ++++++++++++++++++++++++++++ .github/workflows/cron.yaml | 9 +++++++++ .github/workflows/pull-request.yaml | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/cron.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..16e24d7 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,28 @@ +# runs 9 times. Builds each Node version on each OS. + + +on: [push] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node-version: [8.x, 10.x, 12.x] + os: [macos-latest, windows-latest, ubuntu-18.04] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build and test + run: | + npm cli + npm run build --if-present + npm test + env: + CI: true \ No newline at end of file diff --git a/.github/workflows/cron.yaml b/.github/workflows/cron.yaml new file mode 100644 index 0000000..2412193 --- /dev/null +++ b/.github/workflows/cron.yaml @@ -0,0 +1,9 @@ +Name: Weekly Radar + +on: + schedule: + - cron: 0 12 * * 1 + +jobs: + weekly_radar: + name: Weekly Radar \ No newline at end of file diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 54f81f9..fc3afe2 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -11,7 +11,7 @@ jobs: - name: Trigger Workflow in Repository A uses: actions/github-script@v6 with: - github-token: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.STEVEN_RHODES1_TOKEN}} script: | github.actions.createWorkflowDispatch({ owner: 'steven-rhodes1', From 41879076fc0690989fcc309853566d427ee47e67 Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Tue, 16 Apr 2024 20:29:15 -0400 Subject: [PATCH 4/6] testing --- that.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/that.txt b/that.txt index 9ecf3cf..949c08d 100644 --- a/that.txt +++ b/that.txt @@ -1 +1,2 @@ this +something \ No newline at end of file From e5ed9a612e983ab09c8ecac488df597bb4363798 Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Tue, 16 Apr 2024 20:31:15 -0400 Subject: [PATCH 5/6] remove example files --- .github/workflows/build.yaml | 28 ---------------------------- .github/workflows/cron.yaml | 9 --------- 2 files changed, 37 deletions(-) delete mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/cron.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 16e24d7..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# runs 9 times. Builds each Node version on each OS. - - -on: [push] - -jobs: - build: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - node-version: [8.x, 10.x, 12.x] - os: [macos-latest, windows-latest, ubuntu-18.04] - - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: npm install, build and test - run: | - npm cli - npm run build --if-present - npm test - env: - CI: true \ No newline at end of file diff --git a/.github/workflows/cron.yaml b/.github/workflows/cron.yaml deleted file mode 100644 index 2412193..0000000 --- a/.github/workflows/cron.yaml +++ /dev/null @@ -1,9 +0,0 @@ -Name: Weekly Radar - -on: - schedule: - - cron: 0 12 * * 1 - -jobs: - weekly_radar: - name: Weekly Radar \ No newline at end of file From e932190219741b8743ac41dad0d2f0d536c7561c Mon Sep 17 00:00:00 2001 From: Steven Rhodes Date: Tue, 16 Apr 2024 21:58:09 -0400 Subject: [PATCH 6/6] test --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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