Skip to content

Commit 27c9906

Browse files
fix(release_setup)!: use github sha for PRs (#32)
1 parent 7ca1f94 commit 27c9906

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

actions/release_setup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The action does the following:
3030
|--------------------------------|----------------------------------------------------------------------------|
3131
| publish_release | Whether or not to publish a release |
3232
| release_body | The body for the release |
33-
| release_commit | The commit hash for the release |
33+
| release_commit | The commit hash for the release. (i.e. `${GITHUB_SHA}` |
3434
| release_generate_release_notes | Whether or not to generate release notes. True if `release_body` is blank. |
3535
| release_tag | The tag for the release (i.e. `release_version` with prefix) |
3636
| release_version | The version for the release (i.e. `yyyy.mmdd.hhmmss`) |

actions/release_setup/main.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,7 @@ def get_push_event_details() -> dict:
220220

221221
is_pull_request = True if github_event.get("pull_request") else False
222222

223-
try:
224-
# set sha to the head sha of the pull request
225-
github_sha = github_event["pull_request"]["head"]["sha"]
226-
except KeyError:
227-
# not a pull request event
228-
github_sha = os.environ["GITHUB_SHA"]
229-
push_event_details['release_commit'] = github_sha
223+
push_event_details['release_commit'] = os.environ["GITHUB_SHA"]
230224

231225
if is_pull_request:
232226
push_event_details['release_version'] = f'0.0.{github_event["number"]}'

0 commit comments

Comments
 (0)