forked from nasa/cFE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be07f1f
commit 99011a0
Showing
1 changed file
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Entry Point Workflow' | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Checks for duplicate actions. Skips push actions if there is a matching or | ||
# duplicate pull-request action. | ||
checks-for-duplicates: | ||
runs-on: ${{ github.repository_owner == 'cFS' && 'linux' || 'ubuntu-latest' }} | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
concurrent_skipping: 'same_content' | ||
skip_after_successful_duplicate: 'true' | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
|
||
select-internal-external: | ||
name: Use internal or external workflow | ||
needs: checks-for-duplicates | ||
if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') }} | ||
runs-on: ${{ github.repository_owner == 'cFS' && 'linux' || 'ubuntu-latest' }} | ||
|
||
steps: | ||
- name: Set Variables | ||
id: vars | ||
run: echo "REPO_OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV | ||
|
||
- name: Conditional Workflow Invocation | ||
run: | | ||
if [[ "${{ env.REPO_OWNER }}" == "nasa" ]]; then | ||
echo "Triggering internal workflow..." | ||
gh workflow run internal-build-document.yml | ||
elif [[ "${{ env.REPO_OWNER }}" == "cFS" ]]; then | ||
echo "Triggering external workflow..." | ||
gh workflow run external-build-document.yml | ||
else | ||
echo "No matching workflow." | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |