Skip to content

Commit 544d0de

Browse files
committed
docker build on PR instead of just when label is added
1 parent 65b6d6c commit 544d0de

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,10 @@ run-name: Docker build CI triggered from @${{ github.actor }} of ${{ github.head
33
on:
44
workflow_dispatch:
55
pull_request:
6-
types: [labeled]
6+
types: [opened, synchronize, reopened]
77
jobs:
8-
# Only runs Docker build jobs if a PR has received a final "design approved" label as a final check
9-
check-label:
10-
name: Check for required label
11-
runs-on: ubuntu-latest
12-
if: github.event_name == 'pull_request'
13-
outputs:
14-
should-run: ${{ steps.check-label.outputs.has-label }}
15-
steps:
16-
- id: check-label
17-
uses: actions/github-script@v6
18-
with:
19-
script: |
20-
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
21-
owner: context.repo.owner,
22-
repo: context.repo.repo,
23-
issue_number: context.issue.number
24-
});
25-
const hasLabel = labels.some(label => label.name === 'design-approved');
26-
core.setOutput('has-label', hasLabel);
27-
console.log(`PR has 'design-approved' label: ${hasLabel}`);
28-
298
docker:
309
name: Docker build
31-
needs: check-label
32-
# Run if it's not a PR or if it's a PR with the required label
33-
if: github.event_name != 'pull_request' || needs.check-label.outputs.should-run == 'true'
3410
runs-on: arbitrator-ci
3511
services:
3612
# local registry
@@ -108,4 +84,4 @@ jobs:
10884
keys=(${{ runner.os }}-buildx- ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }})
10985
for key in "${keys[@]}"; do
11086
curl -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/caches/$key"
111-
done
87+
done

0 commit comments

Comments
 (0)