Skip to content

Commit

Permalink
docs: github.sha and github.event.pull_request.head.sha (#971)
Browse files Browse the repository at this point in the history
* docs: github.sha and github.event.pull_request.head.sha

* Update context.yml
  • Loading branch information
nakamasato authored Jan 1, 2024
1 parent b0d0069 commit 744997c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ jobs:
name: check if a pr has test label
run: |
echo "- github.event.pull_request.labels has 'test'" >> "$GITHUB_STEP_SUMMARY"
- name: write sha as comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `event: ${{ github.event_name }}\n- github.event.pull_request.head.sha: ${{ github.event.pull_request.head.sha }}\n - github.sha: ${{ github.sha }}`
})
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

### 1. pull_request

- `github.sha` is not the latest commit sha [ref](https://sue445.hatenablog.com/entry/2021/01/07/004835)
- `github.event.pull_request.head.sha` is the sha of the lastest commit [ref](https://github.com/orgs/community/discussions/26676)

|GitHub Actions|Trigger|Description|
|---|---|---|
|[actionlint](.github/workflows/actionlint.yml)| pull_request | [actionlint](https://github.com/rhysd/actionlint) lint for GitHub Actions workflows|
Expand Down

0 comments on commit 744997c

Please sign in to comment.