Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get tag from git #230

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # also fetch tags

- uses: elastic/apm-pipeline-library/.github/actions/docker-login@current
with:
Expand All @@ -24,9 +26,12 @@ jobs:
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}

- name: Set version if tags
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/v')
- name: Set version if tag exists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is wrong... #227 was merged and replace name: Set version if tags with a specific GitHub action for creating docker metadata

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, and the workflow is quite different. I'm going to close this then.

run: |
TAG=$(git tag --points-at HEAD | tail -1)
if [ -n "${TAG}" ]; then
echo "VERSION=${TAG}" >> $GITHUB_ENV
fi

- name: Run publish
run: make publish