iterative / iterative/cml

detect PR from GITHUB_HEAD_REF instead of github.event.pull_request.head.sha

Open
#1,204 4 comments 0 reactions 1 assignee Claimed by @tasdomas View on GitHub
cml-comment enhancement p1-important
Dominant language
JavaScript
Stars
4.2k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

drop the `checkout.with.ref` requirement in favour of CML auto-detecting the PR from the `$GITHUB_HEAD_REF` [env var](https://docs.github.com/en/actions/learn-github-actions/environment-variables)?

```diff
on: pull_request
...
- uses: actions/checkout@v3
- # quite clunky and might not be necessary
- with:
- ref: ${{ github.event.pull_request.head.sha }}
+ # auto-detect PR from $GITHUB_HEAD_REF
- run: cml comment ... --pr
```

in such cases, we can also print a warning message: "`current_sha != GITHUB_HEAD_REF` (so could result in e.g. confusing `dvc diff` etc.) so consider using `ref: ${{ github.event.pull_request.head.sha }}`"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.