Skip to content

Commit edf2226

Browse files
authored
Merge pull request #13 from chessbyte/github_actions_2
GitHub Actions - Use pr_number instead of commit_message in payload
2 parents 899a156 + c50ca09 commit edf2226

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
PAYLOAD_REF: ${{ github.event.client_payload.ref }}
1313
PAYLOAD_SHA: ${{ github.event.client_payload.sha }}
1414
PAYLOAD_REPOSITORY: ${{ github.event.client_payload.repository }}
15-
PAYLOAD_COMMIT_MESSAGE: ${{ github.event.client_payload.commit_message }}
15+
PAYLOAD_PR_NUMBER: ${{ github.event.client_payload.pr_number }}
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Set up Ruby
@@ -25,6 +25,6 @@ jobs:
2525
- name: Build
2626
run: cd manageiq.org & exe/miq build all
2727
- name: Set COMMIT_MESSAGE
28-
run: parse_commit_message.rb >> $GITHUB_ENV
28+
run: create_commit_message.rb >> $GITHUB_ENV
2929
- name: Deploy
3030
run: deploy.sh

parse_commit_message.rb renamed to create_commit_message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env ruby
22

33
message =
4-
if ENV["PAYLOAD_COMMIT_MESSAGE"].to_s =~ /\AMerge pull request (#\d+)/
4+
if ENV["PAYLOAD_PR_NUMBER"].to_s =~ /^(\d+)$/
55
"#{ENV["PAYLOAD_REPOSITORY"]}#{\$1}"
66
else
77
"#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF"]})"

0 commit comments

Comments
 (0)