-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pull_requeset_target with paths to target branches with changes t…
…o drainpipe-dev.
- Loading branch information
Showing
1 changed file
with
6 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
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 [email protected]: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 }} | ||
|