mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Update build.yml
fixing PR label and docker push
This commit is contained in:
parent
2491d81abf
commit
45bb7fa699
1 changed files with 23 additions and 2 deletions
25
.github/workflows/build.yml
vendored
25
.github/workflows/build.yml
vendored
|
|
@ -47,11 +47,32 @@ jobs:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: 386
|
GOARCH: 386
|
||||||
|
|
||||||
|
check-labels:
|
||||||
|
name: Check PR Labels
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
|
outputs:
|
||||||
|
ci_build: ${{ steps.check.outputs.ci_build }}
|
||||||
|
steps:
|
||||||
|
- name: Get PR Labels
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
LABELS=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
|
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name')
|
||||||
|
|
||||||
|
echo "Labels found: $LABELS"
|
||||||
|
|
||||||
|
if echo "$LABELS" | grep -q "CI:Build"; then
|
||||||
|
echo "ci_build=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "ci_build=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
name: Build & Push Docker Image
|
name: Build & Push Docker Image
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'CI:Build')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [lint, build-go]
|
needs: [lint, build-go, check-labels]
|
||||||
|
if: needs.check-labels.outputs.ci_build == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue