Skip to content

Commit

Permalink
fix: use check_pfile to determine initialization status
Browse files Browse the repository at this point in the history
Signed-off-by: Lou DeGenaro <[email protected]>
  • Loading branch information
degenaro committed Nov 28, 2023
1 parent 118d52a commit 73c1296
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,24 @@ jobs:
fetch-depth: 0
ref: main
token: ${{ secrets.GIT_TOKEN }}
- name: Determine initialization status
id: determine_initialization_status
run: |
set +e
bash scripts/automation/check_profile.sh
exitcode="$?"
echo "exitcode: $exitcode"
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
- name: Clone downstream repo
if: steps.determine_initialization_status.outputs.exitcode == '1'
uses: actions/checkout@v2
with:
repository: my-repo-base/my-component-definition
path: './my-component-definition'
token: ${{ secrets.GIT_TOKEN }}
fetch-depth: 0
- name: Update profiles
if: steps.determine_initialization_status.outputs.exitcode == '1'
run: bash scripts/automation/update_downstream.sh
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN }}
Expand Down
13 changes: 13 additions & 0 deletions scripts/automation/check_profile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

source config.env

RESULT=$(ls profiles)

if [[ "$RESULT" == *"$PROFILE"* ]]; then
echo "profile exists, exit 1";
exit 1;
else
echo "profile does not exist, exit 0"
exit 0;
fi

0 comments on commit 73c1296

Please sign in to comment.