Skip to content

Commit b0f6c2c

Browse files
committed
use pr number directly
1 parent 9b8493e commit b0f6c2c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/diff.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
id: regress-ci
2626
env:
2727
GITHUB_COMMENT: ${{ github.event.comment.body }}
28-
GITHUB_COMMENT_PR: ${{ github.event.comment.issue_url }}
28+
GITHUB_COMMENT_PR: ${{ github.event.issue.number }}
2929
diff:
3030
runs-on: ubuntu-latest
3131
needs: [generate]
@@ -55,6 +55,7 @@ jobs:
5555
tool: git-delta
5656

5757
# if a new line is added here, make sure to update the `summary` job to reference the new step index
58+
- run: cargo regress diff ${{ matrix.command }}
5859
- run: cargo regress diff ${{ matrix.command }}
5960
env:
6061
GH_TOKEN: ${{ github.token }}
@@ -68,9 +69,8 @@ jobs:
6869
- uses: actions/checkout@v4
6970

7071
- run: |
71-
PR_ID=$(echo "${{ github.event.comment.issue_url }}" | grep -o '[0-9]\+$')
7272
gh run view ${{ github.run_id }} --json jobs | \
73-
jq -r '"Diff for [comment]("+$comment+")\n\n" + ([.jobs[] | select(.name | startswith("diff")) | "- [" + (.name | capture("\\((?<name>[^,]+),.*") | .name) + "](" + .url + "?pr=" + $pr_id + "#step:7:45)"] | join("\n"))' --arg pr_id "$PR_ID" --arg comment "${{ github.event.comment.url }}"| \
74-
gh pr comment "$PR_ID" --body "$(< /dev/stdin)"
73+
jq -r '"Diff for [comment]("+$comment+")\n\n" + ([.jobs[] | select(.name | startswith("diff")) | "- [" + (.name | capture("\\((?<name>[^,]+),.*") | .name) + "](" + .url + "?pr=" + $pr_id + "#step:7:47)"] | join("\n"))' --arg pr_id "${{ github.event.issue.number }}" --arg comment "${{ github.event.comment.url }}"| \
74+
gh pr comment "${{ github.event.issue.number }}" --body "$(< /dev/stdin)"
7575
env:
7676
GH_TOKEN: ${{ github.token }}

ci/svd2rust-regress/src/ci.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Ci {
1111
#[clap(env = "GITHUB_COMMENT")]
1212
pub comment: String,
1313
#[clap(env = "GITHUB_COMMENT_PR")]
14-
pub comment_pr: String,
14+
pub comment_pr: usize,
1515
}
1616

1717
#[derive(serde::Serialize)]
@@ -32,7 +32,7 @@ impl Ci {
3232
diffs.push(Diff {
3333
needs_semver_checks: command.contains("semver"),
3434
command: command.to_owned(),
35-
pr: self.comment_pr.split('/').last().unwrap().parse()?,
35+
pr: self.comment_pr,
3636
});
3737
}
3838
let json = serde_json::to_string(&diffs)?;

0 commit comments

Comments
 (0)