Skip to content
Merged
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
48 changes: 48 additions & 0 deletions github-modify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# yamllint disable rule:line-length
name: 'Modify external repo to checkout from'
description: "Modify external repo to check out from"
inputs:
repo:
description: "The name of the GitHub repo"
required: true
type: string
runs:
using: "composite"
steps:
- name: Check out jbaublitz/${{ inputs.repo }}
if: github.event_name == 'pull_request'
id: jbaublitz
continue-on-error: true
uses: actions/checkout@v4
with:
repository: jbaublitz/${{ inputs.repo }}
path: jbaublitz
ref: ${{ github.head_ref }}
- name: Check out mulkieran/${{ inputs.repo }}
if: github.event_name == 'pull_request'
id: mulkieran
continue-on-error: true
uses: actions/checkout@v4
with:
repository: mulkieran/${{ inputs.repo }}
path: mulkieran
ref: ${{ github.head_ref }}
- name: Check if both checkouts succeeded
if: github.event_name == 'pull_request' && steps.jbaublitz.outcome == 'success' && steps.mulkieran.outcome == 'success'
run: |
echo "Branch conflict!"
exit 1
- name: Conditionally make jbaublitz checkout branch the chosen one
if: github.event_name == 'pull_request' && steps.jbaublitz.outcome == 'success'
run: mv jbaublitz ${{ inputs.repo }}
- name: Conditionally make mulkieran checkout branch the chosen one
if: github.event_name == 'pull_request' && steps.mulkieran.outcome == 'success'
run: mv mulkieran ${{ inputs.repo }}
- name: Check out stratis-storage repo if no alternative branch was checked out
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && steps.mulkieran.outcome == 'failure' && steps.jbaublitz.outcome == 'failure')
uses: actions/checkout@v4
with:
repository: stratis-storage/${{ inputs.repo }}
path: ${{ inputs.repo }}
ref: master