Skip to content

Commit

Permalink
ci: Remove pull_request_target references (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Aug 12, 2022
1 parent f0af41a commit d95bc3d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Dependabot Automerge"

on:
workflow_run:
workflows:
- "Pull Request Checks"
types:
- completed

jobs:
automerge-dependabot:
name: "Automerge Dependabot PR"
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@main
11 changes: 8 additions & 3 deletions .github/workflows/higgs-shop-sample-app-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Higgs Shop Sample App Pull Request

on:
pull_request:

workflow_call:
inputs:
app_relative_path:
description: 'repo path for sample app'
required: true
type: string

defaults:
run:
working-directory: core-sdk-samples/higgs-shop-sample-app
working-directory: ${{ inputs.app_relative_path }}

jobs:
build-and-test:
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Pull Request Checks"

on: [ pull_request_target ]
on: [ push, workflow_dispatch, pull_request ]

jobs:

Expand All @@ -11,29 +11,21 @@ jobs:
app_relative_path: "core-sdk-samples/higgs-shop-sample-app"

automerge-dependabot:
name: "Automerge Dependabot PR"
name: "Save PR Number for Dependabot Automerge"
needs: [ higgs-shop-sample-app ]
if: ${{ github.actor == 'dependabot[bot]' }}
env:
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
GIT_AUTHOR_NAME: mparticle-bot
GIT_AUTHOR_EMAIL: developers@mparticle.com
GIT_COMMITTER_NAME: mparticle-bot
GIT_COMMITTER_EMAIL: developers@mparticle.com
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: "Rebase Dependabot PR"
uses: actions/github-script@v3
- name: "Checkout PR branch"
uses: actions/checkout@v2
with:
script: |
github.pulls.merge({
owner: context.repo.owner,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
merge_method: 'rebase'
});
rebase-development:
name: "Rebase Development onto Dependabot Branch"
needs: [ automerge-dependabot ]
if: ${{ github.actor == 'dependabot[bot]' }}
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-rebase-development.yml@stable
submodules: recursive
fetch-depth: 0
- name: "Save Pull Request Number"
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/

0 comments on commit d95bc3d

Please sign in to comment.