2022-04-13 17:20:40 +00:00
|
|
|
name: PR for latest Stereoscope release
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 8 * * *" # 3 AM EST
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
2023-09-07 18:55:52 +00:00
|
|
|
GO_VERSION: "1.21.x"
|
2022-04-13 17:20:40 +00:00
|
|
|
GO_STABLE_VERSION: true
|
|
|
|
|
2023-09-15 18:18:42 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-04-13 17:20:40 +00:00
|
|
|
jobs:
|
|
|
|
upgrade-stereoscope:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.repository == 'anchore/syft' # only run for main repo
|
|
|
|
steps:
|
2024-06-13 16:28:04 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
|
2022-04-13 17:20:40 +00:00
|
|
|
|
2024-07-11 17:19:48 +00:00
|
|
|
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 #v5.0.2
|
2022-04-13 17:20:40 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
stable: ${{ env.GO_STABLE_VERSION }}
|
|
|
|
|
2023-10-25 13:08:43 +00:00
|
|
|
- name: Bootstrap environment
|
|
|
|
uses: ./.github/actions/bootstrap
|
|
|
|
|
2022-04-13 17:20:40 +00:00
|
|
|
- run: |
|
|
|
|
LATEST_VERSION=$(git ls-remote https://github.com/anchore/stereoscope main | head -n1 | awk '{print $1;}')
|
|
|
|
|
|
|
|
# update go.mod
|
|
|
|
go get github.com/anchore/stereoscope@$LATEST_VERSION
|
2022-04-13 20:30:35 +00:00
|
|
|
go mod tidy
|
2022-04-13 17:20:40 +00:00
|
|
|
|
|
|
|
# export the version for use with create-pull-request
|
2023-04-03 13:36:11 +00:00
|
|
|
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_OUTPUT
|
2022-04-13 17:20:40 +00:00
|
|
|
id: latest-version
|
|
|
|
|
2023-09-20 14:12:13 +00:00
|
|
|
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
|
2022-04-13 17:20:40 +00:00
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.TOKEN_APP_ID }}
|
|
|
|
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
|
|
|
|
|
2024-06-20 15:12:12 +00:00
|
|
|
- uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
|
2022-04-13 17:20:40 +00:00
|
|
|
with:
|
|
|
|
signoff: true
|
|
|
|
delete-branch: true
|
2023-03-21 15:08:49 +00:00
|
|
|
branch: auto/latest-stereoscope
|
2022-04-13 17:20:40 +00:00
|
|
|
labels: dependencies
|
2023-03-21 15:08:49 +00:00
|
|
|
commit-message: "chore(deps): update stereoscope to ${{ steps.latest-version.outputs.LATEST_VERSION }}"
|
|
|
|
title: "chore(deps): update stereoscope to ${{ steps.latest-version.outputs.LATEST_VERSION }}"
|
2022-04-13 17:20:40 +00:00
|
|
|
body: |
|
|
|
|
Update Stereoscope to ${{ steps.latest-version.outputs.LATEST_VERSION }}
|
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|