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

fix: fix GIT_DIFF in the docker workflow. #3201

Merged
merged 1 commit into from
Jul 15, 2024
Merged
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
21 changes: 8 additions & 13 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/*.go
go.mod
go.sum
**/go.mod
**/go.sum
**/Makefile
Makefile
Dockerfile
- name: Get new commits for nightly build
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
if: "${{ env.GITHUB_EVENT_NAME == 'schedule' }}"

- name: Set new commits for other builds
run: echo "NEW_COMMIT_COUNT=1" >> $GITHUB_ENV
if: "${{ env.GITHUB_EVENT_NAME != 'schedule' }}"

- name: Log in to the Container registry
uses: docker/[email protected]
Expand All @@ -58,4 +53,4 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
if: env.GIT_DIFF
if: ${{ env.NEW_COMMIT_COUNT > 0 }}
Loading