diff --git a/.github/workflows/DrainpipeDev.yml b/.github/workflows/DrainpipeDev.yml index b8fcc8eb3..f07bbd720 100644 --- a/.github/workflows/DrainpipeDev.yml +++ b/.github/workflows/DrainpipeDev.yml @@ -1,9 +1,12 @@ name: Push Drainpipe Dev Package on: + pull_request_target: + paths: + - 'drainpipe-dev/**' push: branches: - '**' + - 'main' tags: - 'v*' delete: @@ -23,19 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Get branch information - id: branch-names - uses: tj-actions/branch-names@v8 - - - name: For non-default branch and non-tags, check if drainpipe-dev was changed - if: ${{ steps.branch-names.outputs.is_default == 'false' || steps.branch-names.outputs.is_tag == 'false' }} - id: files-changed - uses: tj-actions/changed-files@v44 - with: - files: 'drainpipe-dev/**' - - name: Add drainpipe-dev deploy key in order to run git clone - if: ${{ steps.branch-names.outputs.is_default == 'true' || steps.branch-names.outputs.is_tag == 'true' || steps.files-changed.outputs.any_changed == 'true' }} uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }} @@ -44,19 +35,17 @@ jobs: # Commits made by the https://github.com/apps/lullabot-drainpipe application. # @see https://github.com/orgs/community/discussions/24664 - name: Create git checkout of drainpipe-dev - if: ${{ steps.branch-names.outputs.is_default == 'true' || steps.branch-names.outputs.is_tag == 'true' || steps.files-changed.outputs.any_changed == 'true' }} working-directory: drainpipe-dev run: | git init git branch -m ${{ github.ref_name }} git remote add origin git@github.com:Lullabot/drainpipe-dev.git git fetch origin - git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/${{ steps.branch-names.outputs.default_branch }} + git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main git config user.name "Lullabot-Drainpipe[bot]" git config user.email "157769597+Lullabot-Drainpipe[bot]@users.noreply.github.com" - name: Push branch to drainpipe-dev - if: ${{ steps.branch-names.outputs.is_default == 'true' || steps.branch-names.outputs.is_tag == 'true' || steps.files-changed.outputs.any_changed == 'true' }} working-directory: drainpipe-dev run: | git add -A @@ -67,7 +56,7 @@ jobs: COMMIT_MESSAGE: ${{ github.event.head_commit.message }} - name: Push tag to drainpipe-dev - if: ${{ steps.branch-names.outputs.is_tag == 'true' }} + if: ${{ startsWith(github.ref, 'refs/tags/') }} working-directory: drainpipe-dev run: | git tag ${{ github.ref_name }}