Sync Oncall to Google Group and Slack Group #6
This file contains hidden or 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: Sync Oncall to Google Group | |
| on: | |
| schedule: | |
| # Run daily at 01:00 UTC (rotation starts at 00:00 UTC) | |
| - cron: '0 1 * * *' | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: Build synconcall | |
| run: | | |
| cd synconcall | |
| go build -o synconcall | |
| - name: Sync oncall rotation | |
| env: | |
| GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | |
| SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | |
| run: | | |
| cd synconcall | |
| ./synconcall --config=../dev.oncall \ | |
| --group=dev-oncall@bytebase.com --admin-user=d@bytebase.com \ | |
| --slack-group=S0AAPDZBNQL \ | |
| --slack-channel=C08CMEAP63T |