Custom Dependabot #707
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
name: Custom Dependabot | |
# Update Docker Base Images, append changelogs and bump addon patch version | |
on: | |
schedule: | |
- cron: "0 14 * * *" | |
workflow_dispatch: | |
jobs: | |
Dependabot: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install perquisite | |
run: | | |
pip3 install dockerfile-parse | |
- name: Scan for deprecated base images | |
run: | | |
python3 ./.github/resources/custom_dependabot | |
- name: Commit changes | |
id: commit | |
run: | | |
if ! [ -z "$(git status --porcelain)" ]; then | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action Bot" | |
git commit -a -m "Updated base images" | |
echo "change=yes" >> $GITHUB_OUTPUT | |
else | |
echo "Nothing to commit!" | |
echo "change=no" >> $GITHUB_OUTPUT | |
fi | |
- uses: actions/create-github-app-token@v1 | |
if: steps.commit.outputs.change == 'yes' | |
id: generate-token | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Create Pull Request | |
if: steps.commit.outputs.change == 'yes' | |
id: pr | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: Update report | |
committer: merger-bot[bot] <131801252+merger-bot[bot]@users.noreply.github.com> | |
author: merger-bot[bot] <131801252+merger-bot[bot]@users.noreply.github.com> | |
token: ${{ steps.generate-token.outputs.token }} | |
branch: dependabot-update-base-images | |
delete-branch: true | |
title: '[Dependabot] Updated base images' | |
assignees: mietzen | |
labels: | | |
automated pr | |
dependabot | |
- name: Automerge if possible | |
if: steps.commit.outputs.change == 'yes' && steps.pr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
pull-request-number: ${{ steps.pr.outputs.pull-request-number }} | |
merge-method: squash |