Skip to content

Commit

Permalink
Post to phabricator on PR close (#213)
Browse files Browse the repository at this point in the history
Bug: T318703
  • Loading branch information
vivian-rook committed Sep 27, 2022
1 parent 8de422c commit 2d6c137
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ jobs:
- name: post to phabricator
run: |
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}"
git fetch
echo "${message}"
inital_commit=$(git log origin/main..origin/${{ github.head_ref }} --pretty=%H | tail -n1)
task=$(git log -n 1 ${inital_commit} | tail -n1 | grep "^ Bug: T[0-9]*$" | awk '{print $2}')
# if already squashed and merged use the branch name.
if [ -z "${task}" ]; then
task=$(git log -n 1 origin/${{ github.head_ref }} | tail -n1 | grep "^ Bug: T[0-9]*$" | awk '{print $2}')
fi
task=$(curl ${{ github.event.pull_request._links.commits.href }} | jq .[0].commit.message -r | grep "^Bug: T[0-9]*$" | head -1 | awk '{print $2}')
if [ -n "${task}" ]; then
curl https://phabricator.wikimedia.org/api/maniphest.edit \
-d api.token=${{ secrets.TOOLFORGE_PHAB_BOT_KEY }} \
Expand Down

0 comments on commit 2d6c137

Please sign in to comment.