build(deps): bump amazoncorretto from 21.0.0 to 21.0.1 (#12) #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: autotag | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
autotag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags | |
token: ${{ secrets.PAT }} | |
- name: Get previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: v0.0.0 # Optional fallback tag to use when no tag can be found | |
prefix: v # Optional prefix to strip from the tag | |
- name: Read version from file | |
run: | | |
echo "previous_version=${{ steps.previoustag.outputs.tag }}" >> "$GITHUB_ENV" | |
CURRENT_VERSION=$(head -n 1 "Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1) | |
echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_ENV" | |
- name: Set new tag | |
if: env.previous_version != env.current_version | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
github_token: ${{ secrets.PAT }} | |
tag: ${{ env.current_version }} | |
message: "Release ${{ env.current_version }}" | |