Skip to content

Commit 8d4d309

Browse files
committed
ci: test commenting
1 parent 51ff07e commit 8d4d309

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/dockerfile-deps.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,17 @@ jobs:
4242
echo "::error::Dockerfile dependencies validation failed. See job summary for details."
4343
exit 1
4444
45-
# TODO: Optionally add PR comment when validation fails
46-
# - name: Comment on PR with changes (if validation failed)
47-
# if: failure() && github.event_name == 'pull_request'
48-
# uses: actions/github-script@v7
49-
# with:
50-
# script: |
51-
# const fs = require('fs');
52-
# const report = fs.readFileSync('report.md', 'utf8');
53-
#
54-
# await github.rest.issues.createComment({
55-
# owner: context.repo.owner,
56-
# repo: context.repo.repo,
57-
# issue_number: context.issue.number,
58-
# body: `## Dockerfile Dependencies Changed\n\n${report}\n\n---\n*This check ensures Dockerfile dependencies are tracked and validated against the source of truth.*`
59-
# });
45+
- name: Comment on PR with changes (if validation failed)
46+
if: steps.validate.outputs.exit_code != '0' && github.event_name == 'pull_request'
47+
uses: actions/github-script@v7
48+
with:
49+
script: |
50+
const fs = require('fs');
51+
const report = fs.readFileSync('report.md', 'utf8');
52+
53+
await github.rest.issues.createComment({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
issue_number: context.issue.number,
57+
body: `## Dockerfile Dependencies Changed\n\n${report}\n\n---\n*This check ensures Dockerfile dependencies are tracked and validated against the source of truth.*`
58+
});

0 commit comments

Comments
 (0)