45
45
id : pr
46
46
if : github.event_name == 'push' && github.ref == 'refs/heads/staging'
47
47
run : |
48
- NUMBER=$( echo '${{ github.event.head_commit.message }}' | head -1 | tr -cd [:digit:] )
48
+ git log --format=%B -n 1 $GITHUB_SHA | head -1 > /tmp/commit_msg
49
49
50
+ NUMBER=$( cat /tmp/commit_msg | head -1 | tr -cd [:digit:] )
50
51
echo "PR number is: $NUMBER"
51
52
echo "::set-output name=number::$NUMBER"
52
53
59
60
outputs :
60
61
pr_number : ${{ steps.pr.outputs.number }}
61
62
steps :
62
- # - name: Dump context
63
- # uses: crazy-max/[email protected]
63
+ - name : Dump context
64
+
64
65
65
66
- name : Print PR number
66
67
id : pr
@@ -109,8 +110,8 @@ jobs:
109
110
id : info
110
111
uses : Brymastr/pr-info-action@v1
111
112
112
- # - name: Dump context
113
- # uses: crazy-max/[email protected]
113
+ - name : Dump context
114
+
114
115
115
116
- name : Set outputs from pull request event
116
117
if : github.event_name == 'pull_request'
@@ -123,13 +124,14 @@ jobs:
123
124
if : github.event_name == 'push'
124
125
run : |
125
126
echo "PR_BRANCH='$(git rev-parse --abbrev-ref HEAD)'" >> $GITHUB_ENV
126
- echo "PR_BRANCH=' $(git rev-parse --abbrev-ref HEAD)' "
127
+ echo "PR_BRANCH=$(git rev-parse --abbrev-ref HEAD)"
127
128
echo "PR_NUMBER='${{ needs.get_pr_number.outputs.pr_number }}'" >> $GITHUB_ENV
128
129
echo "PR_NUMBER='${{ needs.get_pr_number.outputs.pr_number }}'"
129
130
131
+ # Might need to b64 encode titles, so they can avoid exec from print later on
130
132
# The commit message can be multiple lines, but we only want the first one
131
- echo '${{ github.event.head_commit.message }}' > /tmp/pr-title-tmp
132
- cat /tmp/pr-title-tmp | head -1 > /tmp/pr-title
133
+
134
+ git log --format=%B -n 1 $GITHUB_SHA | head -1 | base64 > /tmp/pr-title
133
135
echo PR_TITLE="$(cat /tmp/pr-title)" >> $GITHUB_ENV
134
136
echo PR_TITLE="$(cat /tmp/pr-title)"
135
137
@@ -146,7 +148,7 @@ jobs:
146
148
echo "pr number is: $PR_NUMBER"
147
149
148
150
echo "::set-output name=title::$PR_TITLE"
149
- echo "pr title is: $PR_TITLE"
151
+ echo "b64 encoded pr title is: $PR_TITLE"
150
152
151
153
# This isn't working as expected
152
154
# bot-label-check:
@@ -181,21 +183,17 @@ jobs:
181
183
git config user.name "${{ env.GIT_BOT_USERNAME }}"
182
184
git config user.email "${{ env.GIT_BOT_EMAIL }}"
183
185
184
- # - name: Dump context
185
- # uses: crazy-max/[email protected]
186
+ - name : Dump context
187
+
186
188
187
189
- name : Simulate PR merge for changelog updates
188
190
run : |
189
191
git checkout ${{ env.DEFAULT_BRANCH }}
190
192
191
- if [[ ${{ github.event_name == 'pull_request' }} = 'true' ]]; then
192
- git commit --all --allow-empty -m "${{ needs.get_pr_info.outputs.pr_title }} (#${{ needs.get_pr_info.outputs.pr_number }})"
193
- fi
194
-
195
- if [[ ${{ github.event_name == 'push' }} = 'true' ]]; then
196
- git commit --all --allow-empty -m "${{ needs.get_pr_info.outputs.pr_title }}"
197
- fi
193
+ # Write commit into file, so we don't have to
194
+ echo ${{ needs.get_pr_info.outputs.pr_title }} | base64 -d > /tmp/commit_title
198
195
196
+ git commit --all --allow-empty -F /tmp/commit_title
199
197
git log -5
200
198
201
199
- name : Generate a changelog
@@ -277,8 +275,8 @@ jobs:
277
275
token : ${{ steps.app.outputs.token }}
278
276
fetch-depth : 0
279
277
280
- # - name: Dump context
281
- # uses: crazy-max/[email protected]
278
+ - name : Dump context
279
+
282
280
283
281
- name : Checkout PR branch
284
282
env :
0 commit comments