Skip to content

Bump trilogy from 2.11.1 to 2.12.2 #105

Bump trilogy from 2.11.1 to 2.12.2

Bump trilogy from 2.11.1 to 2.12.2 #105

name: Dependabot Auto Update
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
export_variables:
# Only run on pull requests created by dependabot
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
packages: read
outputs:
app_image: ${{ steps.compute_container_registry_name.outputs.CR_NAME }}/app:${{ steps.read_app_image_tag.outputs.APP_IMAGE_TAG }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.AUTO_UPDATE_ACCESS_TOKEN }}
- name: Compute container registry name
id: compute_container_registry_name
run: echo "CR_NAME=$(echo ghcr.io/${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Read app image tag
id: read_app_image_tag
run: echo "APP_IMAGE_TAG=$(head -n1 .app-image-tag)" >> $GITHUB_OUTPUT
auto-update:
# Only run on pull requests created by dependabot
if: github.actor == 'dependabot[bot]'
needs: [export_variables]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}
permissions:
contents: write
pull-requests: write
packages: read
container:
image: ${{ needs.export_variables.outputs.app_image }}-4.0.2
volumes:
- .:/app
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.AUTO_UPDATE_ACCESS_TOKEN }}
- name: Bump version in .app-image-tag
run: |
current_version=$(cat .app-image-tag | tr -d '\n')
echo "Current version: $current_version"
# Remove 'v' prefix
version_without_v="${current_version#v}"
# Use awk to increment the last part
new_version="v$(echo "$version_without_v" | awk -F. '{$NF = $NF + 1; print}' OFS='.')"
echo "New version: $new_version"
# Write new version
echo "$new_version" > .app-image-tag
- name: Run bundle install
run: bundle install
- name: Run bundle exec appraisal install
run: bundle exec appraisal install
- name: git status
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git status --verbose
- name: Install bash and gpg to support git-auto-commit-action with signed commits
run: apk add bash gpg gpg-agent
- name: "Import GPG key"
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore: Bump image tag and update lockfiles"
commit_user_name: ${{ secrets.COMMIT_USER_NAME }}
commit_user_email: ${{ secrets.COMMIT_USER_EMAIL }}
commit_author: Github Actions <actions@github.com>
branch: ${{ github.head_ref }}