Only rotate backups on success #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "PR Notification" | |
'on': | |
pull_request: | |
types: [opened, closed] | |
jobs: | |
irc-notification: | |
runs-on: ubuntu-latest | |
name: Notify on IRC | |
steps: | |
- name: irc notification | |
run: | | |
sudo apt-get update | |
sudo apt-get install netcat -y | |
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}" | |
echo -e "USER notefromgithub notefromgithub notefromgithub :notefromgithub\nNICK notefromgithub\nJOIN #wikimedia-cloud-feed\nPRIVMSG #wikimedia-cloud-feed :${message}\nQUIT\n" | nc irc.libera.chat 6667 | |
phabricator-comment: | |
runs-on: ubuntu-latest | |
name: Comment on Phabricator | |
steps: | |
- uses: actions/checkout@v2 | |
- name: post to phabricator | |
run: | | |
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}" | |
echo "${message}" | |
inital_commit=$(git log origin/main..origin/${{ github.head_ref }} --pretty=%H | tail -n1) | |
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 }} \ | |
-d transactions[0][type]=comment \ | |
-d transactions[0][value]="${message}" \ | |
-d objectIdentifier=${task} | |
fi |