-
Notifications
You must be signed in to change notification settings - Fork 2.9k
67 lines (57 loc) · 2.55 KB
/
deployBlocker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Update Deploy Blockers
on:
issues:
types:
- labeled
jobs:
updateChecklist:
if: github.event.label.name == 'DeployBlockerCash'
uses: ./.github/workflows/createDeployChecklist.yml
deployBlocker:
if: github.event.label.name == 'DeployBlockerCash'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Give the issue/PR the Hourly, Engineering labels
run: gh issue edit ${{ github.event.issue.number }} --add-label 'Engineering,Hourly' --remove-label 'Daily,Weekly,Monthly'
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Escape html characters in GH issue title
env:
GH_ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
escaped_title=$(echo "$GH_ISSUE_TITLE" | sed -e 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g; s/|/\|/g')
echo "GH_ISSUE_TITLE=$escaped_title" >> "$GITHUB_ENV"
- name: 'Post the issue in the #expensify-open-source slack room'
if: ${{ success() }}
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
{
channel: '#expensify-open-source',
attachments: [{
color: "#DB4545",
text: '💥 New Deploy Blocker: <${{ github.event.issue.html_url }}|${{ env.GH_ISSUE_TITLE }}>. If you have any idea which PR could be causing this, please comment in the issue.'
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
- name: Comment on deploy blocker
run: |
gh issue comment ${{ github.event.issue.number }} --body "$(cat <<'EOF'
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! [Check out the open \`StagingDeployCash\` deploy checklist](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3AStagingDeployCash) to see the list of PRs included in this release, then work quickly to do one of the following:
1. Identify the pull request that introduced this issue and revert it.
2. Find someone who can quickly fix the issue.
3. Fix the issue yourself.
EOF
)"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Announce failed workflow in Slack
if: ${{ failure() }}
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}