Merge pull request #57 from jun10r4lm31d4/main #45
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: Sort Subdomains | |
on: | |
push: | |
paths: | |
- 'subdomains.json' | |
permissions: | |
contents: write | |
jobs: | |
sort: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Sort subdomains | |
run: npm run sort | |
- name: Commit and push if changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add subdomains.json | |
git diff-index --quiet HEAD || git commit -m "Auto-sort subdomains.json" | |
git push |