Skip to content

Commit

Permalink
chore: save (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
danteay committed Apr 17, 2024
1 parent a97eeba commit ad5f0f3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/tag_logger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
fetch-depth: 2
ref: "main"

- name: Fetch tags for adapter
run: git fetch --tags origin '+refs/tags/adapters/${{ matrix.adapter }}/*:refs/tags/adapters/${{ matrix.adapter }}/*'

- name: Files modified
id: check
uses: tj-actions/[email protected]
with:
files: |
./internal/**
./*.go
./go.mod
./go.sum
run: |
any_changed="false"
if git diff --name-only HEAD^ | grep -q "^internal/"; then
any_changed="true"
fi
# check if any go file in root folder change
if git diff --name-only HEAD^ | grep -E "^([a-z0-9_]+\.go)$|^(go\.(mod|sum))$"; then
any_changed="true"
fi
echo "any_changed=$any_changed" >> $GITHUB_OUTPUT
- name: Config Git User
if: steps.check.outputs.any_changed == 'true'
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/tag_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
fetch-depth: 2
ref: "main"

- name: Fetch tags for adapter
run: git fetch --tags origin '+refs/tags/adapters/${{ matrix.adapter }}/*:refs/tags/adapters/${{ matrix.adapter }}/*'

- name: Files modified
id: check
uses: tj-actions/[email protected]
with:
files: |
./${{ matrix.module }}/**
run: |
any_changed="false"
if git diff --name-only HEAD^ | grep -q "^${{ matrix.module }}/"; then
any_changed="true"
fi
echo "any_changed=$any_changed" >> $GITHUB_OUTPUT
- name: Config Git User
if: steps.check.outputs.any_changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/danteay/golog
go 1.21

require (
github.com/danteay/golog/adapters/slog v0.2.0
github.com/danteay/golog/adapters/slog v0.2.1
github.com/danteay/golog/fields v0.1.0
github.com/danteay/golog/levels v0.1.0
github.com/stretchr/testify v1.9.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/danteay/golog/adapters/slog v0.2.0 h1:out+V8wxc9Qn4cXso13pLKJG18EJI7gAjy4xvnV43v4=
github.com/danteay/golog/adapters/slog v0.2.0/go.mod h1:OmDON9G8qJecuoFjHVyzXb/tIDSH6J9/VW2+4NujrGQ=
github.com/danteay/golog/adapters/slog v0.2.1 h1:Mduw+0EVFGA3fHJJ9u24nUM9ZrndWSBgWxocyJ9/Puo=
github.com/danteay/golog/adapters/slog v0.2.1/go.mod h1:PuACPq2sOwQFEo1hWwfIz7HwwsvSbQn15KMezZm/rkA=
github.com/danteay/golog/fields v0.1.0 h1:/W3Gh3PrVoJsY53sear+yzyLRkIMkM039lOfSNfUFj0=
github.com/danteay/golog/fields v0.1.0/go.mod h1:ACO2Sinx9OSYgwgUVTSZtWaT1q0VzHes6cDVgJtOS4Q=
github.com/danteay/golog/levels v0.1.0 h1:vJqNEKlij90z6b7PSq6bqxmV9KbKn1tj8nlkASl0r14=
Expand Down

0 comments on commit ad5f0f3

Please sign in to comment.