Skip to content

Commit

Permalink
At most one
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Dec 18, 2023
1 parent 731697a commit 7c4cb28
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,27 @@ jobs:
event = json.load(f)
print(event)
labels = event['pull_request']['labels']
print(labels)
for label in labels:
if label['name'].startswith('pipeline-'):
print("Labeled", label)
with open(os.environ['GITHUB_OUTPUT'], 'w') as f:
print("pipeline-label=" + label['name'], file=f)
exit(0)
print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.")
exit(1)
pipeline_labels = [label for label in labels if label['name'].startswith('pipeline-')]
if not pipeline_labels:
print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.")
exit(1)
if len(pipeline_labels) > 1
print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.")
exit(1)
label = pipeline_labels[0]:
print("Labeled", label)
with open(os.environ['GITHUB_OUTPUT'], 'w') as f:
print("pipeline-label=" + label['name'], file=f)
exit(0)
EOF
draft-unless-approved:
needs: labels-for-repertoire-changes
if: needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-16.0'
name: Draft unless approved
runs-on: ubuntu-latest
steps:
- env:
- name: Check draft status
env:
PIPELINE_LABEL: ${{needs.labels-for-repertoire-changes.outputs.pipeline-label}}
run: |
python3 <<EOF
Expand Down

0 comments on commit 7c4cb28

Please sign in to comment.