Update Amazon IVS Player SDK #27
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: Update Amazon IVS Player SDK | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Run daily at midnight UTC | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-ivs-player: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for updates | |
| id: check-updates | |
| run: | | |
| # Extract current version from index.html | |
| CURRENT_VERSION=$(grep -oP 'player\.live-video\.net/\K[0-9]+\.[0-9]+\.[0-9]+' index.html) | |
| echo "Current version: $CURRENT_VERSION" | |
| # Get latest version from npm | |
| LATEST_VERSION=$(npm view amazon-ivs-player version) | |
| echo "Latest version: $LATEST_VERSION" | |
| # Compare versions | |
| if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then | |
| echo "Update available: $CURRENT_VERSION -> $LATEST_VERSION" | |
| echo "has_update=true" >> $GITHUB_OUTPUT | |
| echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | |
| echo "new_version=$LATEST_VERSION" >> $GITHUB_OUTPUT | |
| # Update the script src in index.html | |
| sed -i "s|player\.live-video\.net/$CURRENT_VERSION|player.live-video.net/$LATEST_VERSION|g" index.html | |
| else | |
| echo "No update available" | |
| echo "has_update=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.check-updates.outputs.has_update == 'true' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: 'chore: update Amazon IVS Player SDK to ${{ steps.check-updates.outputs.new_version }}' | |
| title: 'chore: update Amazon IVS Player SDK to ${{ steps.check-updates.outputs.new_version }}' | |
| body: | | |
| This PR updates the Amazon IVS Player SDK from ${{ steps.check-updates.outputs.current_version }} to ${{ steps.check-updates.outputs.new_version }}. | |
| The script source in `index.html` has been updated to use the latest version from the CDN. | |
| This update was automatically generated by the dependency update workflow. | |
| branch: dependency-update/amazon-ivs-player | |
| delete-branch: true |