From 10c9af289c1439f0d3bec3c0c8d264bb79ffc3ba Mon Sep 17 00:00:00 2001 From: GalvinPython <77013913+GalvinPython@users.noreply.github.com> Date: Sun, 30 Jun 2024 14:25:14 +0100 Subject: [PATCH] release: 1.0 --- LICENSE | 0 README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++--- package-lock.json | 4 +-- package.json | 4 +-- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index caab134..a392621 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,63 @@ -> [!CAUTION] -> This action is being tested. Do not attempt to use whilst this warning is active! - # YouTube Readme Updater -Updates your README file to show your latest video uploads \ No newline at end of file +Updates your README file to show your latest video uploads on YouTube! + +# Example Usage +> [!IMPORTANT] +> This action uses NodeJS 20 + +To use, simply create a file called `.github/workflows/main.yml` in your target repository. `main.yml` can be anything as long as it's a `.yml` file + +```yml +name: Update README with latest YouTube videos + +on: + schedule: + - cron: '0 * * * *' # Runs every hour + +jobs: + update-readme: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Update README + uses: GalvinPython/youtube-readme@1.0 + with: + youtube_channel_id: '' # Replace with your channel ID + readme_file_path: 'README.md' + + - name: Configure Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Commit changes + run: | + git add README.md + git commit -m "Update README with latest YouTube videos" || echo "No changes to commit" + + - name: Push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git push +``` + +# API +You can find the server for the API [here](https://github.com/GalvinPython/latest-uploads-api) + +# Future Improvements +* Set a value between 1 and 5 videos +* Choose either shorts, streams or videos (or all) +* Format better +* Video statistics + +# Changelog +## V1.0 +* Released action \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ebada7b..70f388b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "update-youtube-readme", - "version": "1.0.0", + "version": "1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "update-youtube-readme", "version": "1.0.0", - "license": "ISC", + "license": "MIT", "dependencies": { "@actions/core": "^1.10.1" } diff --git a/package.json b/package.json index 997b72f..cb94719 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "update-youtube-readme", - "version": "0.1-rc1", + "version": "1.0", "description": "", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "dependencies": { "@actions/core": "^1.10.1" }