Skip to content

.github/workflows/update-version.yml #390

.github/workflows/update-version.yml

.github/workflows/update-version.yml #390

# update version of jenkins plugins
# daily (on branch update-version)
on:
schedule:
- cron: '0 19 * * *'
workflow_dispatch:
jobs:
jenkins-lts:
runs-on: ubuntu-latest
name: test on jenkins-lts
steps:
- uses: actions/checkout@v3
- name: test jenkins-lts
uses: ./test/jenkins-lts/
- name: Update last good version
if: github.event_name != 'pull_request'
run: |
chmod +x ./test/update-version.sh
./test/update-version.sh
git status --porcelain ./test/jenkins-last README.md
if [ $(git status --porcelain ./test/jenkins-last README.md | wc -l) -eq 0 ]; then
echo "jenkins_last_changed=false" >> ${GITHUB_ENV}
else
echo "jenkins_last_changed=true" >> ${GITHUB_ENV}
git diff
git config --global user.name 'logparser-action'
git config --global user.email 'logparser-action@users.noreply.github.com'
git add ./test/jenkins-last README.md
git commit -m "[bot] Update last good jenkins version tested"
fi
- name: push last good version
if: github.event_name != 'pull_request' && env.jenkins_last_changed == 'true'
run: |
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
git fetch
git checkout -B update-version
git push --force-with-lease --set-upstream origin update-version
else
git push
fi