Skip to content

Commit

Permalink
add output for sharing tags between jobs
Browse files Browse the repository at this point in the history
issue #44
  • Loading branch information
Jaroslav380 committed Feb 5, 2025
1 parent 5e383ab commit 910e56f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
build-test-push:
runs-on: ubuntu-latest

outputs:
branch_name: ${{ steps.branch.outputs.branch_name }}
commit_hash: ${{ steps.commit.outputs.commit_hash }}

steps:
- uses: actions/checkout@v3
name: checkout
Expand Down Expand Up @@ -56,7 +60,7 @@ jobs:

- name: Get branch name
id: branch
run: echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
run: echo "branch_name=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV

- name: Get commit hash
id: commit
Expand All @@ -73,13 +77,11 @@ jobs:
needs: build-test-push

steps:
- name: Get branch name
id: branch
run: echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Get branch name from build-test-push
run: echo "BRANCH_NAME=${{ needs.build-test-push.outputs.branch_name }}" >> $GITHUB_ENV

- name: Get commit hash
id: commit
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Get commit hash from build-test-push
run: echo "COMMIT_HASH=${{ needs.build-test-push.outputs.commit_hash }}" >> $GITHUB_ENV

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.29.0
Expand Down

0 comments on commit 910e56f

Please sign in to comment.