.github/workflows/update-version.yml #378
This file contains 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
# 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 |