Get Latest TGIK Episodes #643
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 TGIK 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: Checkout TGIK Branch | |
run: | | |
git checkout -B youtube-tgik-${{ github.run_id }} | |
- uses: ./.github/actions/youtube-episodes | |
name: Get Latest TGIK Episodes (creates local changes) | |
env: | |
API_KEY: ${{ secrets.YT_API_KEY }} | |
PLAYLIST_ID: "PL7bmigfV0EqQzxcNpmcdTJ9eFRPBe-iZa" | |
EPISODES_PATH: "content/tv/tgik/" | |
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-tgik-${{ github.run_id }} |