Skip to content

🔄 synced file(s) with PaddleHQ/go-library-template #86

🔄 synced file(s) with PaddleHQ/go-library-template

🔄 synced file(s) with PaddleHQ/go-library-template #86

Workflow file for this run

# DO NOT EDIT: This file should only be modified in the `go-library-template` repo.
name: Check for major dependency updates
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
actions: write # required for `workflow-dispatch` to trigger the automerge workflow
jobs:
major:
name: Check for major dependency updates
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up Go
uses: ./.github/actions/setup-go
with:
owner: ${{ github.repository_owner }}
private: ${{ github.event.repository.private }}
private-key: ${{ secrets.PRIVATE_GO_CI_PRIVATE_KEY }}
clear-token: 'false'
- name: Install `gomajor`
run: go install github.com/icholy/gomajor@4439c423d4f92ed1214c2a51750b6c34c4c70aa6 # v0.14.0
- name: Run `gomajor`
id: gomajor
env:
GOPRIVATE: github.com/PaddleHQ/*
run: |
# mockery v2 is ignored while we make a decision on how we upgrade.
# see https://paddle.slack.com/archives/CCALA6J23/p1744297603199989
export PATH=${PATH}:`go env GOPATH`/bin
{
echo 'major_dependencies<<EOF'
gomajor list -major -pre | grep -v github.com/vektra/mockery/v2 | awk '{print "> "$0}'
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Remove git token from cache
shell: bash
run: git credential-cache exit
- name: Comment PR to update major dependencies
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3
with:
comment-tag: major_dependencies
mode: ${{ steps.gomajor.outputs.major_dependencies != '' && 'upsert' || 'delete' }}
message: |
> [!IMPORTANT]
> ## :warning: Major dependencies need updated :warning:
>
> The following major dependencies are outdated:
> ```
${{ steps.gomajor.outputs.major_dependencies }}
> ```
- name: Automerge
uses: ./.github/actions/trigger-automerge
with:
event: ${{ toJSON(github.event) }}
hasAutoApproverPrivateKey: ${{ secrets.AUTO_APPROVER_PRIVATE_KEY != '' }}