build: fix labeler config #292
This file contains 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: Build | |
on: | |
push: | |
branches: | |
- '*' | |
- '!main' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
status: | |
name: Success build | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- id: status | |
name: Load failure jobs count | |
env: | |
URL: https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | |
USER: admin:${{ secrets.GITHUB_TOKEN }} | |
FILTER: "[.jobs[] | select(.status==\"completed\" and .conclusion==\"failure\") | { status: .conclusion, matrix: .name}] | length" | |
run: | | |
FAILURE_COUNT=$(curl -X GET -s -u $USER $URL | jq "$FILTER") | |
echo "fails=$FAILURE_COUNT" >> $GITHUB_OUTPUT | |
echo Failure jobs count: $FAILURE_COUNT | |
- if: ${{ steps.status.outputs.fails > 0 }} | |
name: Fail | |
run: exit 1 | |