This repository was archived by the owner on Mar 31, 2025. It is now read-only.
Exporter for Spotify playlist #5
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: Exporter for Spotify playlist | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| playlist_id: | |
| description: Define the playlist id you want to export | |
| type: string | |
| required: true | |
| jobs: | |
| save_playlist: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| name: Run the application | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Repo checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip3 install -r requirements.txt | |
| - name: Create .cache | |
| run: | | |
| cat <<EOF > .cache | |
| { | |
| "access_token": "${{ secrets.ACCESS_TOKEN }}", | |
| "token_type": "Bearer", | |
| "expires_in": 3600, | |
| "scope": "playlist-modify-public", | |
| "expires_at": ${{ secrets.EXPIRES_AT }}, | |
| "refresh_token": "${{ secrets.REFRESH_TOKEN }}" | |
| } | |
| EOF | |
| - name: Execute python script | |
| run: python3 exporter.py | |
| env: | |
| SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }} | |
| SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }} | |
| SPOTIPY_REDIRECT_URI: ${{ secrets.SPOTIPY_REDIRECT_URI }} | |
| SPOTIFY_USER: ${{ secrets.SPOTIFY_USER }} | |
| playlist_id: ${{ inputs.playlist_id }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ inputs.playlist_id }} | |
| path: ${{ inputs.playlist_id }}.txt |