mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Update build.yml
This commit is contained in:
parent
012b6018b0
commit
48e9d096e8
1 changed files with 20 additions and 8 deletions
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
|
|
@ -47,25 +47,37 @@ jobs:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: 386
|
GOARCH: 386
|
||||||
|
|
||||||
check-labels:
|
check-labels:
|
||||||
name: Check PR Labels
|
name: Check PR Labels
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
steps:
|
steps:
|
||||||
- name: Debug PR Number & API Response
|
- name: Debug PR Number
|
||||||
run: |
|
run: |
|
||||||
echo "Checking labels for PR #${{ github.event.pull_request.number }}"
|
echo "PR Number: ${{ github.event.pull_request.number }}"
|
||||||
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels"
|
|
||||||
|
|
||||||
- name: Fetch PR Labels
|
- name: Fetch PR Labels
|
||||||
id: label-check
|
id: label-check
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
LABELS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
PR_NUMBER="${{ github.event.pull_request.number }}"
|
||||||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name')
|
|
||||||
|
if [ -z "$PR_NUMBER" ]; then
|
||||||
|
echo "PR number is empty. This might not be running on a PR merge."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
API_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels"
|
||||||
|
echo "Fetching labels from: $API_URL"
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "$API_URL")
|
||||||
|
echo "API Response: $RESPONSE"
|
||||||
|
|
||||||
|
LABELS=$(echo "$RESPONSE" | jq -r '.[].name')
|
||||||
|
|
||||||
echo "Found labels: $LABELS"
|
echo "Found labels: $LABELS"
|
||||||
|
|
||||||
# Set environment variable instead of using set-output
|
|
||||||
if echo "$LABELS" | grep -q "CI:Build"; then
|
if echo "$LABELS" | grep -q "CI:Build"; then
|
||||||
echo "ci_build=true" >> $GITHUB_ENV
|
echo "ci_build=true" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue