Get Latest tanzu-talk Episodes #50
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: Get Latest tanzu-talk Episodes | |
on: | |
schedule: | |
- cron: "0 16 * * 2,3,5" | |
workflow_dispatch: | |
jobs: | |
get-episodes: | |
if: github.repository == 'vmware-tanzu/tanzu-dev-portal' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
with: | |
fetch-depth: 1 | |
token: ${{ secrets.PA_TOKEN }} | |
- name: Create tanzu-talk Branch | |
run: | | |
git checkout -B youtube-tanzu-talk-${{ github.run_id }} | |
- uses: ./.github/actions/youtube-episodes | |
name: Get Latest tanzu-talk Episodes (creates local changes) | |
env: | |
API_KEY: ${{ secrets.YT_API_KEY }} | |
PLAYLIST_ID: "PLAdzTan_eSPRNuA52_34wh5VTBC-0Rz7U" | |
EPISODES_PATH: "content/tv/talk/" | |
IMG_PATH_PREFIX: "images/" | |
TEMPLATE_FILE: ".github/actions/youtube-episodes/src/template.md" | |
- name: Check for modified files | |
id: git-check | |
run: | | |
git add --all | |
echo ::set-output name=modified::$(if git diff --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
- name: Commit files | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Add changes" -a | |
git push origin youtube-tanzu-talk-${{ github.run_id }} |