Skip to content

Commit 744ef42

Browse files
authored
Update label_issues_customer_deployed.yml
1 parent 45e6201 commit 744ef42

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/label_issues_customer_deployed.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Set up Python
2525
uses: actions/setup-python@v4
@@ -29,24 +29,26 @@ jobs:
2929
- name: Install Dependencies
3030
run: |
3131
python -m pip install --upgrade pip
32-
pip install requests
32+
pip install requests urllib3
3333
34+
# Run the Python script directly with environment variables
3435
- name: Add Customer Deployed Labels
3536
env:
3637
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
RELEASE_LABEL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_label || github.event.client_payload.release_label }}
3739
run: |
38-
# Determine the release label
39-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
40-
RELEASE_LABEL="${{ github.event.inputs.release_label }}"
41-
elif [ "${{ github.event_name }}" == "repository_dispatch" ]; then
42-
RELEASE_LABEL="${{ github.event.client_payload.release_label }}"
43-
else
44-
echo "Error: Unknown event trigger"
40+
if [ -z "$GITHUB_TOKEN" ]; then
41+
echo "Error: GITHUB_TOKEN is not defined"
42+
exit 1
43+
fi
44+
45+
if [ -z "$RELEASE_LABEL" ]; then
46+
echo "Error: Could not determine release label"
4547
exit 1
4648
fi
4749
4850
echo "Adding Customer Deployed labels for release: $RELEASE_LABEL"
4951
50-
# Execute the Python script
52+
# Execute the Python script from the correct directory
5153
cd scripts/dev-metrics
5254
python add_customer_deployed_label.py --release-label "$RELEASE_LABEL"

0 commit comments

Comments
 (0)