Skip to content

Commit

Permalink
Extract tag or branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsloan committed Apr 4, 2024
1 parent a7ad15d commit 3845a62
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ jobs:
path: ~/**/target/libs/*.jar
key: assembly-${{ matrix.module }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Extract branch or tag name
run: |
if [[ $GITHUB_REF == refs/heads/* ]]; then
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
env:
GITHUB_REF: ${{ github.ref }}
shell: bash
id: extract_branch_or_tag
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
Expand All @@ -230,7 +241,7 @@ jobs:
format: 'HTML'
args: >-
--failOnCVSS 5
--suppression https://raw.githubusercontent.com/lensesio/stream-reactor/${{ steps.extract_branch.outputs.branch }}/suppression.xml
--suppression https://raw.githubusercontent.com/lensesio/stream-reactor/${{ steps.extract_branch_or_tag.outputs.branch }}/suppression.xml
- name: Upload Test results
uses: actions/upload-artifact@master
with:
Expand Down

0 comments on commit 3845a62

Please sign in to comment.