Update Postman Collection Nightly #183
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: Update Postman Collection Nightly | |
on: | |
# Run every day at midnight | |
schedule: | |
- cron: '0 0 * * *' | |
# Allow manual triggering from the Actions tab | |
workflow_dispatch: | |
# Run when a pull request is opened to verify. | |
pull_request: | |
types: [opened, synchronize] | |
# Jobs to be executed | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
# Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
# Install the requests library to make HTTP requests | |
- name: Install dependencies | |
run: pip install requests | |
# Execute the Python script to generate the collection | |
- name: Execute Python script | |
env: | |
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }} | |
run: python generate.py | |
# Commit any changes to the collection | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
if: github.event_name != 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
commit_message: 'ci: Update Postman Collection' | |
branch: main | |
commit_user_name: Github-Actions 🤖 | |
commit_user_email: [email protected] | |
commit_author: Github-Actions🤖 <[email protected]> | |
# Sync the collection with Postman | |
- name: Sync Postman Collections | |
uses: jneate/postman-collection-action@v1 | |
with: | |
postmanApiKey: ${{ secrets.POSTMAN_API_KEY }} | |
postmanWorkspaceId: d598cc9d-84bf-4e1d-8da2-6ee69c8ecd62 | |
postmanTimeout: 30000 | |
# Keep the workflow alive | |
- uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings | |
if: github.event_name != 'pull_request' |