Skip to content

Commit 2637469

Browse files
committed
ci: try to simplify posting comments
1 parent 50acba3 commit 2637469

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

.github/workflows/std.yml

+3-11
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,9 @@ jobs:
178178
nix run -L ".#[email protected]" | tee k8s-plan.diff
179179
'
180180
- name: Post Comment on the PR
181-
uses: actions/github-script@v5
182-
with:
183-
script: |
184-
const fs = require('fs');
185-
const output = fs.readFileSync('k8s-plan.diff', 'utf8');
186-
github.rest.issues.createComment({
187-
issue_number: context.issue.number,
188-
owner: context.repo.owner,
189-
repo: context.repo.repo,
190-
body: "```diff\n" + output + "\n```\n",
191-
});
181+
run: |
182+
prNumber=$(cut -d/ -f1 <<<'${{ github.ref_name }}')
183+
gh pr comment "$prNumber" --body "$(sed -e '2i\\n```diff' -e '$a```' k8s-plan.diff)"
192184
193185
194186
deploy-to-us:

0 commit comments

Comments
 (0)