Update Release List #1660
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 Release List | |
| on: | |
| #release: | |
| # types: [published] | |
| workflow_run: | |
| workflows: ["Build Vim"] | |
| branches: [master] | |
| types: [completed] | |
| permissions: | |
| actions: write # to cancel a workflow run | |
| contents: write # to update wiki | |
| env: | |
| # Account for committing | |
| USER_NAME: "github-actions[bot]" | |
| USER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" | |
| # Escape sequences | |
| COL_RED: "\x1b[31m" | |
| COL_GREEN: "\x1b[32m" | |
| COL_YELLOW: "\x1b[33m" | |
| COL_RESET: "\x1b[m" | |
| jobs: | |
| update: | |
| runs-on: ubuntu-slim | |
| if: ${{ github.repository_owner == 'vim' && github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| with: | |
| path: main | |
| - uses: actions/checkout@v7.0.0 | |
| with: | |
| repository: "${{ github.repository }}.wiki" | |
| path: wiki | |
| - name: Update Release List | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| cd wiki | |
| ../main/scripts/update-release-list.py | |
| git add Releases-in-*.md | |
| if git diff HEAD --quiet; then | |
| echo ${COL_YELLOW}No updates.${COL_RESET} | |
| gh run cancel "${{ github.run_id }}" --repo "${{ github.repository }}" | |
| exit 0 | |
| else | |
| latest=$(cat ../main/vimver.txt) | |
| git config --local user.name ${USER_NAME} | |
| git config --local user.email ${USER_EMAIL} | |
| git commit -a -m "Update Release List to ${latest}" | |
| git push origin HEAD | |
| fi |