fix(actions): fix checkout issues #18
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 Website Submodule" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| update-website: | |
| name: "Update submodule in allthingslinux website" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Generate GitHub App Token" | |
| id: app-token | |
| uses: "actions/create-github-app-token@v1" | |
| with: | |
| app-id: ${{ secrets.WEBSITE_APP_ID }} | |
| private-key: ${{ secrets.WEBSITE_APP_PRIVATE_KEY }} | |
| owner: "allthingslinux" | |
| - name: "Checkout website repository" | |
| uses: "actions/checkout@v4" | |
| with: | |
| repository: "allthingslinux/allthingslinux" | |
| token: ${{ steps.app-token.outputs.token }} | |
| submodules: true | |
| - name: "Update code-of-conduct submodule" | |
| run: | | |
| git submodule update --remote | |
| git add code-of-conduct | |
| - name: "Commit and push changes" | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git add . | |
| git commit -m "chore(coc): update code-of-conduct submodule" | |
| git push | |
| fi |