Merge pull request #862 from Griefed/dependabot-gradle-serverpackcrea… #2
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: Update README with blog posts and sponsors | ||
| on: | ||
| workflow_dispatch: | ||
| jobs: | ||
| blog: | ||
| runs-on: ubuntu-latest | ||
| name: "Fetch and Generate Blog Posts" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: Griefed/ServerPackCreator | ||
| ref: main | ||
| - uses: release-kit/hash-files@v1 | ||
| id: get-current-hash | ||
| with: | ||
| patterns: | | ||
| README.md | ||
| - name: Current README hash | ||
| run: echo ${{ steps.get-current-hash.outputs.hash }} | ||
| - name: Add GitHub Sponsors to Readme | ||
| uses: JamesIves/github-sponsors-readme-action@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| active-only: false | ||
| file: 'README.md' | ||
| - uses: actions-cool/contributor-helper@v1.2.1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| update-files: 'README.md' | ||
| update-places: '<!-- contributors -->/<!-- contributors end -->' | ||
| repo: 'Griefed/ServerPackCreator' | ||
| show-total: false | ||
| style: 'base' | ||
| avatar-width: '70' | ||
| - uses: release-kit/hash-files@v1 | ||
| id: get-new-hash | ||
| with: | ||
| patterns: | | ||
| README.md | ||
| - name: New README hash | ||
| run: echo ${{ steps.get-new-hash.outputs.hash }} | ||
| - name: Push | ||
| if: "${{ steps.get-current-hash.outputs.hash }}" != "${{ steps.get-new-hash.outputs.hash }}" | ||
| run: | | ||
| apt-get update && apt-get install git -y && \ | ||
| git config user.name ${{ secrets.GIT_USER }} && \ | ||
| git config user.email ${{ secrets.GIT_MAIL }} && \ | ||
| pwd && ls -ahl && \ | ||
| git add README.md && \ | ||
| wait && \ | ||
| git status && \ | ||
| git commit -m 'chore: Update sponsors and contributors' && \ | ||
| git push "https://${{ secrets.GIT_USER }}:${{ secrets.GITLAB_TOKEN }}@${{ secrets.CI_SERVER_HOST }}/${{ secrets.GIT_USER }}/${{ secrets.CI_PROJECT_TITLE }}.git" | ||