JSON Generator - Contributors #14928
This file contains hidden or 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: JSON Generator - Contributors | |
| on: | |
| schedule: | |
| - cron: "*/20 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate: | |
| name: Generate Contributors List | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.FA_TOKEN }} | |
| - name: Generating | |
| run: | | |
| FOLDER="util/names" | |
| OUTPUT_FILE="util/contributors.json" | |
| echo "[" > "$OUTPUT_FILE" | |
| echo "\"STICKnoLOGIC\"," >> "$OUTPUT_FILE" | |
| echo "\"STICKnoLOGIC\"," >> "$OUTPUT_FILE" | |
| echo "\"STICKnoLOGIC\"," >> "$OUTPUT_FILE" | |
| echo "\"SnL\"," >> "$OUTPUT_FILE" | |
| echo "\"SnL\"," >> "$OUTPUT_FILE" | |
| echo "\"SnL\"," >> "$OUTPUT_FILE" | |
| #ISPIRED BY First-Contributions by @firstcontributions | |
| echo "\"@firstcontributions\"," >> "$OUTPUT_FILE" | |
| echo "\"@firstcontributions\"," >> "$OUTPUT_FILE" | |
| echo "\"@firstcontributions\"," >> "$OUTPUT_FILE" | |
| #BIG SHOUT OUT | |
| echo "\"js.org\"," >> "$OUTPUT_FILE" | |
| echo "\"js.org\"," >> "$OUTPUT_FILE" | |
| echo "\"js.org\"," >> "$OUTPUT_FILE" | |
| #OTHER CONTRIBUTOR | |
| echo "\"sammy200-ui\"," >> "$OUTPUT_FILE" | |
| for FILE in "$FOLDER"/*; do | |
| [ -f "$FILE" ] && echo "$(jq -R -s . < "$FILE")," >> "$OUTPUT_FILE" | |
| done | |
| sed -i '$ s/,$//' "$OUTPUT_FILE" | |
| echo "]" >> "$OUTPUT_FILE" | |
| echo "JSON file created at $OUTPUT_FILE" | |
| - name: Publishing | |
| run: | | |
| git config --global user.name 'STICKnoLOGIC' | |
| git config --global user.email '[email protected]' | |
| git add util/. | |
| if git commit -m 'Generate Contributors List'; then | |
| echo 'commited' | |
| fi | |
| if git push ; then | |
| echo 'pushed' | |
| fi |