Skip to content

Commit 4ac41dd

Browse files
fix(docker-build): skip hadolint comment outside of PR context (#75)
1 parent aaf5faf commit 4ac41dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/docker-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,19 @@ jobs:
151151
echo "report<<EOF" >> "$GITHUB_OUTPUT"
152152
cat hadolint.txt >> "$GITHUB_OUTPUT"
153153
echo "EOF" >> "$GITHUB_OUTPUT"
154+
cat hadolint.txt
154155
155156
- name: Find existing Hadolint comment
156157
id: find_hadolint
157-
if: ${{ inputs.hadolint }}
158+
if: ${{ github.event_name == 'pull_request' && inputs.hadolint }}
158159
uses: peter-evans/find-comment@v3
159160
with:
160161
issue-number: ${{ github.event.pull_request.number }}
161162
comment-author: "github-actions[bot]"
162163
body-includes: "Hadolint Dockerfile Lint Results"
163164

164165
- name: Create or update Hadolint comment
165-
if: ${{ inputs.hadolint && steps.read_hadolint.outputs.report != '' }}
166+
if: ${{ github.event_name == 'pull_request' && inputs.hadolint && steps.read_hadolint.outputs.report != '' }}
166167
uses: peter-evans/create-or-update-comment@v4
167168
with:
168169
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)