Skip to content

Commit

Permalink
Merge pull request #31505 from Expensify/Rory-RefactorDeployBlockers
Browse files Browse the repository at this point in the history
[No QA] Update deployBlocker workflow to stop using community actions
  • Loading branch information
roryabraham authored Nov 17, 2023
2 parents bc29583 + d983267 commit 7c3b07a
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/deployBlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get URL, title, & number of new deploy blocker (issue)
if: ${{ github.event_name == 'issues' }}
env:
TITLE: ${{ github.event.issue.title }}
run: |
{ echo "DEPLOY_BLOCKER_URL=${{ github.event.issue.html_url }}";
echo "DEPLOY_BLOCKER_NUMBER=${{ github.event.issue.number }}";
echo "DEPLOY_BLOCKER_TITLE=$(sed -e "s/'/'\\\\''/g; s/\`/\\\\\`/g; 1s/^/'/; \$s/\$/'/" <<< "$TITLE")";} >> "$GITHUB_ENV"
- uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Update StagingDeployCash with new deploy blocker
uses: Expensify/App/.github/actions/javascript/createOrUpdateStagingDeploy@main
uses: ./.github/actions/javascript/createOrUpdateStagingDeploy
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

- name: Give the issue/PR the Hourly, Engineering labels
uses: andymckay/labeler@978f846c4ca6299fd136f465b42c5e87aca28cac
with:
add-labels: 'Hourly, Engineering'
remove-labels: 'Daily, Weekly, Monthly'
- run: gh issue edit --add-label 'Engineering,Hourly' --remove-label 'Daily,Weekly,Monthly'
env:
GITHUB_TOKEN: ${{ github.token }}

- name: 'Post the issue in the #expensify-open-source slack room'
if: ${{ success() }}
Expand All @@ -46,26 +40,27 @@ jobs:
channel: '#expensify-open-source',
attachments: [{
color: "#DB4545",
text: '💥 We have found a New Expensify Deploy Blocker, if you have any idea which PR could be causing this, please comment in the issue: <${{ env.DEPLOY_BLOCKER_URL }}|'+ `${{ env.DEPLOY_BLOCKER_TITLE }}`.replace(/(^'|'$)/gi, '').replace(/'\''/gi,'\'') + '>',
text: '💥 We have found a New Expensify Deploy Blocker, if you have any idea which PR could be causing this, please comment in the issue: <${{ github.event.issue.html_url }}|${{ toJSON(github.event.issue.title) }}>',
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: Comment on deferred PR
uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac
with:
github_token: ${{ secrets.OS_BOTIFY_TOKEN }}
number: ${{ env.DEPLOY_BLOCKER_NUMBER }}
body: |
: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.
- 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: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
with:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit 7c3b07a

Please sign in to comment.