Skip to content

Commit

Permalink
Utils connection pipeline start
Browse files Browse the repository at this point in the history
  • Loading branch information
pospisilf committed Jan 26, 2024
1 parent 95ef486 commit 58b04a7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,25 @@ jobs:
REPO_URL="https://api.github.com/repos/$USER/vscode-uitests-tooling/branches"
BRANCH_EXISTS=$(curl -s "$REPO_URL" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq -r '.[] | select(.name=="'"$BRANCH"'") | .name')
BRANCH_EXISTS_MAIN=$(curl -s "$REPO_URL" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq -r '.[] | select(.name=="'"main"'") | .name')
echo $USER
echo $BRANCH
echo $REPO_URL
echo $BRANCH_EXISTS
echo $BRANCH_EXISTS_MAIN
echo $BRANCH_EXISTS == $BRANCH
echo $"$BRANCH_EXISTS" == "$BRANCH"
RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$REPO_URL")
if [ $? -ne 0 ]; then
echo "Error fetching branches from $REPO_URL"
exit 1
fi
BRANCH_EXISTS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="'"$BRANCH"'") | .name')
if [ "$BRANCH_EXISTS" == "$BRANCH" ]; then
echo "BRANCH_EXISTS=true" >> $GITHUB_ENV
echo "Branch existuje"
echo "branch existuje"
echo "BRANCH_EXISTS=true" >> $GITHUB_ENV
else
echo "Branch neexistuje"
echo "BRANCH_EXISTS=false" >> $GITHUB_ENV
echo "branch neexistuje"
echo "BRANCH_EXISTS=false" >> $GITHUB_ENV
- name: kill pipeline
run: |
Expand Down

0 comments on commit 58b04a7

Please sign in to comment.