Trigger Lunch Bot #10
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: Trigger Lunch Bot | |
| on: | |
| schedule: | |
| - cron: '30 6 * * 1-5' | |
| workflow_dispatch: | |
| jobs: | |
| trigger: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Call lunch endpoint | |
| env: | |
| LUNCH_BOT_ENDPOINT_URL: ${{ secrets.LUNCH_BOT_ENDPOINT_URL }} | |
| LUNCH_BOT_TRIGGER_KEY: ${{ secrets.LUNCH_BOT_TRIGGER_KEY }} | |
| run: | | |
| if [[ -z "$LUNCH_BOT_ENDPOINT_URL" ]]; then | |
| echo "Missing LUNCH_BOT_ENDPOINT_URL secret" | |
| exit 1 | |
| fi | |
| if [[ -z "$LUNCH_BOT_TRIGGER_KEY" ]]; then | |
| echo "Missing LUNCH_BOT_TRIGGER_KEY secret" | |
| exit 1 | |
| fi | |
| curl --fail --silent --show-error \ | |
| --request POST \ | |
| --header "x-trigger-key: $LUNCH_BOT_TRIGGER_KEY" \ | |
| "$LUNCH_BOT_ENDPOINT_URL?bypass=true" |