ci: Add name of updated parsers to commit message

Fixes #3962
This commit is contained in:
Stephan Seitz 2022-12-14 22:56:43 +01:00 committed by Christian Clason
parent c5d025c467
commit 818fb3b96b

View file

@ -24,6 +24,9 @@ jobs:
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
mv ./jq-linux64 /tmp/jq
chmod +x /tmp/jq
wget https://github.com/josephburnett/jd/releases/download/v1.6.1/jd-amd64-linux
mv ./jd-amd64-linux /tmp/jd
chmod +x /tmp/jd
sudo apt install libfuse2
wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage
chmod u+x nvim.appimage
@ -34,6 +37,7 @@ jobs:
env:
SKIP_LOCKFILE_UPDATE_FOR_LANGS: verilog,gleam,nix
run: |
cp lockfile.json /tmp/old_lockfile.json
./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q"
# Pretty print
cp lockfile.json /tmp/lockfile.json
@ -44,14 +48,15 @@ jobs:
git config user.name "GitHub"
git config user.email "noreply@github.com"
git add lockfile.json
git commit -m "Update lockfile.json" || echo 'No commit necessary!'
UPDATED_PARSERS=$(echo $(/tmp/jd -set /tmp/old_lockfile.json lockfile.json | grep @ | sed 's/","revision"\]//' | sed 's/@ \["//') | sed 's/ /, /g')
echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV
git commit -m "Update parsers: $UPDATED_PARSERS" || echo 'No commit necessary!'
git clean -xf
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update lockfile.json
title: Update lockfile.json
title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}"
branch: update-lockfile-pr
base: ${{ github.head_ref }}
draft: true