Skip to content

Commit

Permalink
👻 workflow must use correct addon branch (#561)
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad authored Apr 3, 2024
1 parent b5f82e5 commit cbe0801
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/demo-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ jobs:
run: |
echo "${{ github.event.pull_request.body }}"
PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'Addon PR: \K\d+' || true)
echo "API_TESTS_REF=main" >> $GITHUB_ENV
if [ -z "$PULL_REQUEST_NUMBER" ]; then
echo "ADDON_REF=main" >>$GITHUB_ENV
if [ -z "${{ github.event.pull_request.base.ref }}" ]; then
echo "Using addon branch main"
echo "ADDON_REF=main" >>$GITHUB_ENV
else
echo "Using addon branch ${{ github.event.pull_request.base.ref }}"
echo "ADDON_REF=${{ github.event.pull_request.base.ref }}" >>$GITHUB_ENV
# when we know the base branch, we should use the identical branch of api tests
echo "API_TESTS_REF=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
fi
else
echo "ADDON_REF=refs/pull/$PULL_REQUEST_NUMBER/merge" >>$GITHUB_ENV
fi
Expand All @@ -37,13 +46,6 @@ jobs:
<(yq -P 'sort_keys(..)' -o=props <(git show HEAD:demo-dep-output.yaml)) \
<(yq -P 'sort_keys(..)' -o=props <(cat demo-dep-output.yaml))
# - name: run demo image and ensure dependency output unchanged
# run: |
# podman run --entrypoint /usr/bin/konveyor-analyzer-dep -v $(pwd)/demo-dep-output.yaml:/analyzer-lsp/demo-dep-output.yaml:Z localhost/testing:latest --output-file=demo-dep-output.yaml --dep-output-file=de
# diff \
# <(yq -P 'sort_keys(..)' -o=props <(git show HEAD:demo-dep-output.yaml)) \
# <(yq -P 'sort_keys(..)' -o=props <(cat demo-dep-output.yaml))

- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand All @@ -69,3 +71,4 @@ jobs:
uses: konveyor/ci/.github/workflows/global-ci.yml@main
with:
component_name: tackle2-addon-analyzer
api_tests_ref: "${{ env.API_TESTS_REF }}"

0 comments on commit cbe0801

Please sign in to comment.