Skip to content

Commit

Permalink
workflow debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
KPrasch committed Feb 14, 2024
1 parent c0fadbe commit 480a151
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
File renamed without changes.
37 changes: 25 additions & 12 deletions .github/workflows/lynx-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,35 @@ on:
- epic-*

jobs:
lynx-docker:
check-labels:
runs-on: ubuntu-latest
outputs:
has-matching-label: ${{ steps.label-check.outputs.match-found }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Print a message if 'lynx' label is present
if: github.event.pull_request.labels.*.name == 'Lynx 🐳'
run: echo "The 'lynx' label is present. Proceeding with Docker build and push operations."

- name: Print the labels
run: echo "The labels are ${{ github.event.pull_request.labels }}"
- id: label-check
name: Check for Specific Label
run: |
LABEL_MATCH="Lynx"
MATCH_FOUND="false"
for label in $(echo '${{ toJson(github.event.pull_request.labels.*.name) }}' | jq -r '.[]'); do
echo "label=$label" >> $GITHUB_OUTPUT
if [[ "$label" == "$LABEL_MATCH" ]]; then
MATCH_FOUND="true"
break
fi
done
echo "match-found=$MATCH_FOUND" >> $GITHUB_OUTPUT
env:
GITHUB_OUTPUT: $GITHUB_ENV

lynx-docker:
needs: check-labels
if: needs.check-labels.outputs.has-matching-label == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Call Docker Workflow if Label is Present
if: github.event.pull_request.labels.*.name == 'Lynx 🐳'
uses: ./.github/workflows/lynx-docker.yml@main
uses: ./.github/actions/lynx-docker
with:
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 480a151

Please sign in to comment.