Check access to API #1046
This file contains 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: Check access to API | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 12 * * *" | |
jobs: | |
check-api: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
participant: [mst, sacrt, sbmtd] | |
env: [qa, prod] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: "cal-itp/littlepay" | |
- name: Install the littlepay library | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -e . | |
- name: Create config file and set config | |
run: | | |
cat > config.yaml <<- EOM | |
${{ secrets.API_CHECK_CONFIG }} | |
EOM | |
littlepay config config.yaml | |
- name: Run littlepay to get access token | |
run: | | |
littlepay switch env ${{ matrix.env }} | |
littlepay switch participant ${{ matrix.participant }} | |
- name: Report failure to Slack | |
if: always() | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |