Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Refactor action (#5747)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshraj8843 committed Jun 16, 2024
1 parent 30248bd commit f5dbe3b
Show file tree
Hide file tree
Showing 316 changed files with 27,348 additions and 15,619 deletions.
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* text=auto eol=lf

action/dist/** -diff linguist-generated=true
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
# Code owners for 'program' folder
/program/program/ @codinasion/program

# Code owners for Website(s) and api(s)
/website/ @codinasion/web-dev @harshraj8843


# Code owners for Github Bot(s)
/github-bots/ @codinasion/github-bot @harshraj8843
/bot/ @codinasion/github-bot @harshraj8843


# Code owners for README and translations
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/collect-blog-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Collect Blog Data

on:
schedule:
- cron: "17 0 * * *"
workflow_dispatch:
inputs:
TEST:
description: "This is a test ?"
required: true
type: boolean
default: false
RUNNER:
type: choice
description: "Action Runner"
default: "self-hosted"
required: true
options:
- "ubuntu-latest"
- "self-hosted"

jobs:
collect-blog-data:
name: Collect Blog Data

runs-on: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.RUNNER == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Collect Blog Data
id: collect-blog-data
uses: ./action/
with:
TEST: ${{ inputs.TEST || 'false' }}

# Trigger
TRIGGER_COLLECT_BLOG_DATA: true

# Secrets
GITHUB_TOKEN: ${{ secrets.CODINASION_GITHUB_TOKEN }}

- name: Get Time
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
id: time
uses: nanzm/get-time-action@master
with:
timeZone: UTC+5.5
format: "YYYY-MM-DD-HH-mm-ss"

- name: Commit Blog Data
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
uses: crazy-max/ghaction-github-pages@v3.0.0
with:
target_branch: "blog-data"
build_dir: blog-data
keep_history: false
committer: Harsh Raj <harshraj8843@users.noreply.github.com>
author: Harsh Raj <harshraj8843@users.noreply.github.com>
commit_message: |
Collect Blog Data - ${{ steps.time.outputs.time }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/collect-tools-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Collect Tools Data

on:
schedule:
- cron: "17 0 * * *"
workflow_dispatch:
inputs:
TEST:
description: "This is a test ?"
required: true
type: boolean
default: false
RUNNER:
type: choice
description: "Action Runner"
default: "self-hosted"
required: true
options:
- "ubuntu-latest"
- "self-hosted"

jobs:
collect-tools-data:
name: Collect Tools Data

runs-on: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.RUNNER == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Collect Tools Data
id: collect-tools-data
uses: ./action/
with:
TEST: ${{ inputs.TEST || 'false' }}

# Trigger
TRIGGER_COLLECT_TOOLS_DATA: true

# Secrets
GITHUB_TOKEN: ${{ secrets.CODINASION_GITHUB_TOKEN }}

- name: Get Time
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
id: time
uses: nanzm/get-time-action@master
with:
timeZone: UTC+5.5
format: "YYYY-MM-DD-HH-mm-ss"

- name: Commit Tools Data
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
uses: crazy-max/ghaction-github-pages@v3.0.0
with:
target_branch: "tools-data"
build_dir: tools-data
keep_history: false
committer: Harsh Raj <harshraj8843@users.noreply.github.com>
author: Harsh Raj <harshraj8843@users.noreply.github.com>
commit_message: |
Collect Tools Data - ${{ steps.time.outputs.time }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ program-data/
contributors-data/
trending-repos.png
meme.png
.venv
Empty file removed .gitmodules
Empty file.
3 changes: 3 additions & 0 deletions action/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
coverage/
16 changes: 16 additions & 0 deletions action/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
8 changes: 6 additions & 2 deletions action/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Codinasion GitHub Actions

[![Collect Program Data](https://github.com/codinasion/codinasion/actions/workflows/collect-program-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/collect-program-data.yml) [![Collect Contributors Data](https://github.com/codinasion/codinasion/actions/workflows/collect-contributors-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/collect-contributors-data.yml)
[![Collect Program Data](https://github.com/codinasion/codinasion/actions/workflows/collect-program-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/collect-program-data.yml)
[![Collect Contributors Data](https://github.com/codinasion/codinasion/actions/workflows/collect-contributors-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/collect-contributors-data.yml)

[![Tweet GFI Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-gfi-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-gfi-data.yml) [![Tweet Trending Repos Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-trending-repos-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-trending-repos-data.yml) [![Tweet Quote Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-quote-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-quote-data.yml) [![Tweet Meme](https://github.com/codinasion/codinasion/actions/workflows/tweet-meme.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-meme.yml)
[![Tweet GFI Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-gfi-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-gfi-data.yml)
[![Tweet Trending Repos Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-trending-repos-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-trending-repos-data.yml)
[![Tweet Quote Data](https://github.com/codinasion/codinasion/actions/workflows/tweet-quote-data.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-quote-data.yml)
[![Tweet Meme](https://github.com/codinasion/codinasion/actions/workflows/tweet-meme.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/tweet-meme.yml)

[![Submit Program](https://github.com/codinasion/codinasion/actions/workflows/submit-program.yml/badge.svg)](https://github.com/codinasion/codinasion/actions/workflows/submit-program.yml)
106 changes: 58 additions & 48 deletions action/action.yml
Original file line number Diff line number Diff line change
@@ -1,122 +1,132 @@
name: "action"
description: "Codinasion GitHub Actions"
author: "Codinasion"
name: 'action'
description: 'Codinasion GitHub Actions'
author: 'Codinasion'

# Define your inputs here.
inputs:
GITHUB_TOKEN:
description: "`content: read` GitHub Token"
description: '`content: read` GitHub Token'
required: true

TRIGGER_COLLECT_PROGRAM_DATA:
description: "Trigger collect program data"
description: 'Trigger collect program data'
required: true
default: "false"
default: 'false'

TRIGGER_COLLECT_CONTRIBUTORS_DATA:
description: "Trigger collect contributors data"
description: 'Trigger collect contributors data'
required: true
default: "false"
default: 'false'

TRIGGER_TWEET_GFI_DATA:
description: "Trigger tweet GFI data"
description: 'Trigger tweet GFI data'
required: true
default: "false"
default: 'false'

TRIGGER_TWEET_TRENDING_REPOS_DATA:
description: "Trigger tweet trending repos data"
description: 'Trigger tweet trending repos data'
required: true
default: "false"
default: 'false'

TRIGGER_TWEET_QUOTE_DATA:
description: "Trigger tweet quote data"
description: 'Trigger tweet quote data'
required: true
default: "false"
default: 'false'

TRIGGER_TWEET_MEME:
description: "Trigger tweet meme"
description: 'Trigger tweet meme'
required: true
default: "false"
default: 'false'

TRIGGER_SUBMIT_PROGRAM:
description: "Trigger submit program"
description: 'Trigger submit program'
required: true
default: "false"
default: 'false'

TRIGGER_SUBMIT_PROGRAM_COMMENT_CLOSE:
description: "Trigger submit program comment close"
description: 'Trigger submit program comment close'
required: true
default: "false"
default: 'false'

TRIGGER_AUTO_CREATE_ISSUE:
description: "Trigger auto create issue"
description: 'Trigger auto create issue'
required: true
default: "false"
default: 'false'

TRIGGER_AUTO_TRACK_ISSUE:
description: "Trigger auto track issue"
description: 'Trigger auto track issue'
required: true
default: "false"
default: 'false'

TRIGGER_COLLECT_TOOLS_DATA:
description: 'Trigger collect tools data'
required: true
default: 'false'

TRIGGER_COLLECT_BLOG_DATA:
description: 'Trigger collect blog data'
required: true
default: 'false'

TWITTER_APP_KEY:
description: "twitter app key"
description: 'twitter app key'
required: true
default: ""
default: ''

TWITTER_APP_SECRET:
description: "twitter app secret"
description: 'twitter app secret'
required: true
default: ""
default: ''

TWITTER_ACCESS_TOKEN:
description: "twitter access token"
description: 'twitter access token'
required: true
default: ""
default: ''

TWITTER_ACCESS_SECRET:
description: "twitter access secret"
description: 'twitter access secret'
required: true
default: ""
default: ''

TEST:
description: "is test?"
description: 'is test?'
required: true
default: "false"
default: 'false'

SUBMIT_PROGRAM_USERNAME:
description: "submit program username"
description: 'submit program username'
required: true
default: ""
default: ''

SUBMIT_PROGRAM_ISSUE_NUMBER:
description: "submit program issue number"
description: 'submit program issue number'
required: true
default: ""
default: ''

SUBMIT_PROGRAM_TITLE:
description: "submit program title"
description: 'submit program title'
required: true
default: ""
default: ''

SUBMIT_PROGRAM_BODY:
description: "submit program body"
description: 'submit program body'
required: true
default: ""
default: ''

AUTO_TRACK_ISSUE_NUMBER:
description: "auto track issue number"
description: 'auto track issue number'
required: true
default: ""
default: ''

AUTO_TRACK_ISSUE_TITLE:
description: "auto track issue title"
description: 'auto track issue title'
required: true
default: ""
default: ''

AUTO_TRACK_ISSUE_BODY:
description: "auto track issue body"
description: 'auto track issue body'
required: true
default: ""
default: ''

runs:
using: node20
Expand Down
Loading

0 comments on commit f5dbe3b

Please sign in to comment.