Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
check-label:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.labelcheck.outputs.skip }}
steps:
- name: Get PR for commit
id: pr
uses: actions-ecosystem/action-get-latest-pr@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check labels
id: labelcheck
run: |
if echo "${{ steps.pr.outputs.labels }}" | grep -q "NO_DOCKER"; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
Expand All @@ -29,12 +48,8 @@ jobs:
packages: write
attestations: write
id-token: write
pull-requests: read
if: >
!(
github.event_name == 'push' &&
contains(steps.pr.outputs.labels, 'NO_DOCKER')
)
needs: check-label
if: needs.check-label.outputs.skip != 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
Loading