Skip to content

Commit

Permalink
add slack token env and also make slack channel configurable
Browse files Browse the repository at this point in the history
Signed-off-by: samuelarogbonlo <[email protected]>
  • Loading branch information
samuelarogbonlo committed Nov 16, 2023
1 parent c3f2dbf commit 817563d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/mirror-builtin-actors.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
name: Mirror Builtin Actors Releases

on:
# schedule:
# - cron: '0 * * * *' # Runs every hour
pull_request:
branches:
- main
paths:
- 'script/mirror-builtin-actors.sh'
push:
branches:
- main
paths:
- 'script/mirror-builtin-actors.sh'
workflow_dispatch:
Expand All @@ -33,6 +28,9 @@ jobs:
working-directory: script
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: bash ./mirror-builtin-actors.sh filecoin-builtin-actors/actors
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_TOKEN }}


mirror-releases-cf:
needs: mirror-releases-do
Expand All @@ -47,9 +45,12 @@ jobs:
provider: cloudflare
access_key: ${{ secrets.R2_ACCESS_KEY }}
secret_key: ${{ secrets.R2_SECRET_KEY }}
account_id: 2238a825c5aca59233eab1f221f7aefb
account_id: "2238a825c5aca59233eab1f221f7aefb"

- name: Run mirroring script to Cloudflare
working-directory: script
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
run: bash ./mirror-builtin-actors.sh filecoin-builtin-actors/actors
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: "#forest-dump"
2 changes: 1 addition & 1 deletion scripts/mirror-builtin-actors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ send_slack_alert_with_summary() {
local message="Builtin-actors assets upload summary:\n✅ Successful: $success_list\n🔥 Failed: $failure_list"

curl -X POST -H 'Content-type: application/json' -H "Authorization: Bearer $SLACK_API_TOKEN" \
--data "{\"channel\":\"#forest-dump\",\"text\":\"${message}\"}" \
--data "{\"channel\":\"#SLACK_CHANNEL\",\"text\":\"${message}\"}" \
https://slack.com/api/chat.postMessage
}

Expand Down

0 comments on commit 817563d

Please sign in to comment.