Skip to content

Commit 2831b3a

Browse files
author
Oleg
committed
Build and publish image after successfull dependabot PR
1 parent a53b777 commit 2831b3a

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/dependabot-build.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,25 @@ on:
77

88
permissions: {}
99

10+
concurrency:
11+
# in this case if several dependabot PRs are merged only the latest one will build and publish the image
12+
group: dependabot-${{ github.event.workflow_run.event }}-${{ github.event.workflow_run.triggering_actor.login }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
build-and-publish:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Print trigger event
15-
env:
16-
EVENT_PAYLOAD: ${{ toJson(github.event) }}
17-
run: echo $EVENT_PAYLOAD
17+
if: |
18+
github.event.workflow_run.event == 'pull_request'
19+
&& github.event.workflow_run.conclusion == 'success'
20+
&& github.event.workflow_run.triggering_actor.login == 'dependabot[bot]'
21+
22+
permissions:
23+
id-token: write
24+
contents: read
25+
attestations: write
26+
packages: write
27+
28+
uses: ./.github/workflows/build-image.yml
29+
with:
30+
is-latest: true
31+
publish-image: true

0 commit comments

Comments
 (0)