[Config Registry] 1/5 Add gitlab step and json configuration file and yaml for doc #3010
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Do Not Merge | |
| on: | |
| pull_request: | |
| types: [synchronize, opened, reopened, labeled, unlabeled] | |
| jobs: | |
| do-not-merge: | |
| name: Blocked by label | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fail if 'status:do-not-merge' label is present | |
| id: check-label | |
| env: | |
| LABELS_JSON: ${{ toJson(github.event.pull_request.labels) }} | |
| run: | | |
| set -x | |
| # The multiline string needs to be reformed into 'real' JSON again | |
| MATCH=$(jq -Rs 'fromjson | map(select(.name == "status:do-not-merge")) | length' <<<"$LABELS_JSON") | |
| if [ "$MATCH" -gt 0 ]; then | |
| echo "Label 'status:do-not-merge' is present. Failing the job." | |
| echo "found=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Label 'status:do-not-merge' is NOT present. Passing." | |
| echo "found=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Fail if label is present | |
| if: steps.check-label.outputs.found == 'true' | |
| run: | | |
| echo "❌ Label 'status:do-not-merge' is present. Failing the job." | |
| exit 1 |