Skip to content

Commit

Permalink
GH Action: Change logic for finding out latest release
Browse files Browse the repository at this point in the history
Not newest git tag, but latest release from GitHub.
Matches the one installed in the docker image using "go install ..@latest"
  • Loading branch information
schnatterer committed Oct 25, 2023
1 parent 70d7bfe commit 2e05935
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
steps:
- name: Checkout image repo
uses: actions/checkout@v3
- name: Checkout upstream repo
uses: actions/checkout@v3
with:
repository: mailhog/mailhog
token: ${{ secrets.GITHUB_TOKEN }}
path: upstream
# We're only interested in the tags, so check them out, too (not just a single commit)
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -32,9 +24,8 @@ jobs:
- name: Create tags
id: create-tag
run: |
# Find latest tag
cd upstream
VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))"
# Find latest release (same as "go install github.com/mailhog/MailHog@latest" in Dockerfile)
VERSION="$( curl -s -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/mailhog/mailhog/releases/latest" | jq -r '.tag_name')"
VERSION_DATE="$VERSION-$(date +'%Y-%m-%d')"
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/mailhog
Expand Down

0 comments on commit 2e05935

Please sign in to comment.