Skip to content

Commit

Permalink
update readme docs and fixed typo on action workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
VasilisTako committed Mar 14, 2024
1 parent 024a546 commit b7adbb7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upload-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
env:
ANCHOR_EMAIL: ${{ secrets.ANCHOR_EMAIL }}
ANCHOR_PASSWORD: ${{ secrets.ANCHOR_PASSWORD }}
SPOTIFY_EMAIL: ${{ secrets.ANCHOR_EMAIL }}
SPOTIFY_EMAIL: ${{ secrets.SPOTIFY_EMAIL }}
SPOTIFY_PASSWORD: ${{ secrets.SPOTIFY_PASSWORD }}
EPISODE_PATH: /github/workspace
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,31 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Upload Episode from YouTube To Anchor.Fm
uses: Schrodinger-Hat/youtube-to-anchorfm@v2.0.0
uses: Schrodinger-Hat/youtube-to-anchorfm@v2.3.0
env:
ANCHOR_EMAIL: ${{ secrets.ANCHOR_EMAIL }}
ANCHOR_PASSWORD: ${{ secrets.ANCHOR_PASSWORD }}
SPOTIFY_EMAIL: ${{ secrets.SPOTIFY_EMAIL }}
SPOTIFY_PASSWORD: ${{ secrets.SPOTIFY_PASSWORD }}
EPISODE_PATH: /github/workspace
```
**NOTE**: you need to [set up the secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for _ANCHOR_EMAIL_ and _ANCHOR_PASSWORD_. This environment variables are mandatory as they specify the sign in account.
**NOTE**: you need to [set up the secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for _ANCHOR_EMAIL_ and _ANCHOR_PASSWORD_. This environment variables are mandatory as they specify the sign in account.
Instead the _SPOTIFY_EMAIL_ and _SPOTIFY_PASSWORD_ are not mandatory but can still be set, if needed, and will be used for the new login form if the env variable _ANCHOR_LOGIN_ is set to false.
## Environment variables
### Login Type
Setting the `ANCHOR_LOGIN` to true makes the script login with the old anchor login type. Instead setting it to false makes the script login with the spotify account. By default the value is true.

```yaml
env:
ANCHOR_LOGIN: true
```

### Draft Mode

By setting the `SAVE_AS_DRAFT`, the new episode will be published as a draft. This can be useful if you need someone else's
Expand Down Expand Up @@ -203,6 +216,8 @@ jobs:
env:
ANCHOR_EMAIL: ${{ secrets.ANCHOR_EMAIL_GREATNEWS}} # OR secrets.ANCHOR_EMAIL_SADNEWS
ANCHOR_PASSWORD: ${{ secrets.ANCHOR_PASSWORD_GREATNEWS }} # OR secrets.ANCHOR_PASSWORD_SADNEWS
SPOTIFY_EMAIL: ${{ secrets.SPOTIFY_EMAIL_GREATNEWS }} # OR secrets.SPOTIFY_EMAIL_SADNEWS
SPOTIFY_PASSWORD: ${{ secrets.SPOTIFY_PASSWORD_GREATNEWS }} # OR secrets.SPOTIFY_PASSWORD_SADNEWS
EPISODE_PATH: /github/workspace/
EPISODE_FILE: great-news.json
# (…) Other configs as needed
Expand All @@ -225,6 +240,8 @@ To do that, you can copy `.env.sample` into a file with name `.env`.
Make sure to specify the mandatory environment variables for logging in to Anchor.fm,
`ANCHOR_EMAIL` and `ANCHOR_PASSWORD`.

If needed we can set the `SPOTIFY_EMAIL` and `SPOTIFY_PASSWORD` too, so they will be used to login with the new login type after changing `ANCHOR_LOGIN` to false.

Finally, you can do `npm start` to execute the script.

## How to upload a YouTube playlist to Anchor.fm using this script?
Expand Down

0 comments on commit b7adbb7

Please sign in to comment.