From 50d39d0466ef5e30a3cd812f896a5470c4d8265a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?doy=E2=80=A2Tech?= Date: Tue, 29 Aug 2023 16:05:17 +0300 Subject: [PATCH] action updated --- action.yml | 97 +++++++++++++++--------------------------------------- 1 file changed, 26 insertions(+), 71 deletions(-) diff --git a/action.yml b/action.yml index 0f29338..f9c45df 100644 --- a/action.yml +++ b/action.yml @@ -1,71 +1,26 @@ -name: ReadMe Worker 🚧 - -on: - workflow_dispatch: - schedule: - # Runs every minute - - cron: "* */8 * * *" - -jobs: - build: - name: Build 👔 - runs-on: ubuntu-latest - steps: - - name: Checkout code ⛵️ - uses: actions/checkout@v3 - with: - ref: main - token: ${{ secrets.GH_PAT }} # make sure this secret is available in your repo settings - - - name: Setup new branch 🌿 - run: | - git config --global user.email "aldoyh@gmail.com" - git config --global user.name "Mastermind ⛵️" - git checkout -b todoist-stats-update - - - name: Update todoist stats 📊 - uses: aldoyh/todoist-readme@master - outputs: - report: ${{ steps.todoist-stats.outputs.report }} - with: - TODOIST_API_KEY: ${{ secrets.TODOIST_API_KEY }} - - - name: Check for changes in README.md 📝 - id: diff-check - run: | - git diff --exit-code --quiet origin/main README.md || echo "difference=true" >> $GITHUB_ENV - - deploy: - name: Deployment ⛴️ - runs-on: ubuntu-latest - needs: build - steps: - - name: Commit and push changes 🚀 - run: | - if [[ "${{ env.difference }}" == "true" ]]; then - git add . - git commit -m "Update todoist stats" - git fetch origin todoist-stats-update - git reset --hard origin/todoist-stats-update - git push --force-with-lease origin/todoist-stats-update - else - echo "No changes in README.md" - fi - echo "🚧 Diff: ${{ env.difference }}" - - - name: Merge into main 📦 - run: | - if [[ "${{ env.difference }}" == "true" ]]; then - git checkout main - git merge --no-ff todoist-stats-update - git push origin main - else - echo "No changes to merge into main" - fi - - - name: Post to Slack 💬 - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - INPUT_SLACK_MESSAGE: ${{ steps.todoist-stats.outputs.report }} - INPUT_CHANNEL_ID: 'C040ZLS7P2P' +name: 'Todoist Readme' +author: Abhishek Naidu +description: '🚧 Updates README with your Todoist stats' + +inputs: + TODOIST_API_KEY: + description: 'Your Todoist API Key' + required: true + + USERNAME: + description: 'Your GitHub username' + default: ${{ github.repository_owner }} + required: false + + PREMIUM: + description: 'Premium User or Not' + default: false + required: false + +runs: + using: "node12" + main: "dist/index.js" + +branding: + icon: "activity" + color: "red" \ No newline at end of file