Skip to content

Update Release List #1660

Update Release List

Update Release List #1660

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