Skip to content

Commit

Permalink
ci: do not run compose if it is running
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywang committed Nov 6, 2023
1 parent 01548ba commit 4bfa7e7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/trigger-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,42 @@ jobs:
fi
if [[ "$COMPOSE_ID" != "false" ]]; then
gh pr list -R virt-s1/rhel-edge --state open --json title --jq '.[].title' > PR_LIST
PR_LIST=$(cat PR_LIST)
cat $PR_LIST
if [[ $PR_LIST == *"$COMPOSE_ID"* ]]; then
echo "pr_running=true" >> $GITHUB_OUTPUT
else
echo "pr_running=false" >> $GITHUB_OUTPUT
fi
OSBUILD_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version=$OSBUILD_VERSION" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=$OSBUILD_COMPOSER_VERSION" >> $GITHUB_OUTPUT
echo "composer_cli_version=$COMPOSER_CLI_VERSION" >> $GITHUB_OUTPUT
else
echo "osbuild_version=Null" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=Null" >> $GITHUB_OUTPUT
echo "composer_cli_version=Null" >> $GITHUB_OUTPUT
fi
echo "rawhide_compose=$COMPOSE_ID" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

outputs:
rawhide_compose: ${{ steps.check_compose_id.outputs.rawhide_compose }}
osbuild_version: ${{ steps.check_compose_id.outputs.osbuild_version }}
osbuild_composer_version: ${{ steps.check_compose_id.outputs.osbuild_composer_version }}
composer_cli_version: ${{ steps.check_compose_id.outputs.composer_cli_version }}
pr_running: ${{ steps.check_compose_id.outputs.pr_running }}

fedora-rawhide:
needs: check-compose
if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' }}
if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' && needs.check-compose.outputs.pr_running == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit 4bfa7e7

Please sign in to comment.