Skip to content

Commit

Permalink
prefix in different step?
Browse files Browse the repository at this point in the history
  • Loading branch information
pospisilf committed Feb 8, 2024
1 parent 3dcefce commit 6bc0822
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,35 @@ concurrency:
cancel-in-progress: true

jobs:
somerandomjob:
init:
if: always()
runs-on: ubuntu-latest
name: utils fork check
env:
USER: "${{ github.repository_owner }}"
BRANCH: "${{ github.ref_name }}"
TOKEN: "${{ secrets.GITHUB_TOKEN }}"
outputs:
branchExists: ${{ steps.checkBranch.outputs.exists }}

steps:
- name: something
run: echo "somethingggg"
- name: Check for branch in vscode-uitests-tooling (macos, ubuntu)
id: checkBranch
run: |
REPO_URL="https://api.github.com/repos/$USER/vscode-uitests-tooling/branches"
RESPONSE=$(curl -s -H "Authorization: Bearer $TOKEN" "$REPO_URL")
if ([ $? -ne 0 ]); then
echo "exists=false" >> $GITHUB_OUTPUT
fi
BRANCH_EXISTS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="'"$BRANCH"'") | .name')
if [ "$BRANCH_EXISTS" == "$BRANCH" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
main:
strategy:
Expand All @@ -31,14 +53,20 @@ jobs:
env:
CODE_VERSION: ${{ matrix.version }}
CODE_TYPE: ${{ matrix.type }}
TEST_RESO URCES: test-resources
TEST_RESOURCES: test-resources
USER: "${{ github.repository_owner }}"
BRANCH: "${{ github.ref_name }}"
TOKEN: "${{ secrets.GITHUB_TOKEN }}"

runs-on: ${{ matrix.os }}
needs: [ somerandomjob ]
needs: [ init ]
steps:
- name: kill pipeline
run: |
echo ${{needs.init.outputs.branchExists}}
KILLER = "${{github.event.pull_request.user.login}}?
echo $KILLER
- name: Checkout Repository
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 6bc0822

Please sign in to comment.