Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): 🔖 add appropriate labels to PRs with failed checks #2785

Merged
merged 9 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
build:
Expand All @@ -49,6 +50,18 @@ jobs:
run: bun install --frozen-lockfile

- name: 🚀 Test + Build
id: build
run: |
bun test
bun run vscode:prepublish

- name: 🏷️ Manage label based on build result
if: ${{ always() }}
run: |
if [ "${{ steps.build.outcome }}" == "failure" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "invalid-build"
else
gh pr edit ${{ github.event.pull_request.number }} --remove-label "invalid-build"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/color-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
color-check:
Expand All @@ -26,6 +27,18 @@ jobs:
git fetch origin $TARGET_BRANCH

- name: 🎨 Check colors
id: color-check
run: |
svgFiles=$(git diff origin/$TARGET_BRANCH --diff-filter=ACMRTUX --name-only | grep '.svg$')
npx svg-color-linter --config material-colors.yml ${svgFiles}

- name: 🏷️ Manage label based on color check result
if: ${{ always() }}
run: |
if [ "${{ steps.color-check.outcome }}" == "failure" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "invalid-colors"
else
gh pr edit ${{ github.event.pull_request.number }} --remove-label "invalid-colors"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}
HELP_URL: https://github.com/material-extensions/vscode-material-icon-theme/blob/main/CONTRIBUTING.md#conventional-pull-request-titles
run: echo "$PR_TITLE" | npx commitlint --help-url $HELP_URL

- name: 🏷️ Manage label based on PR title check result
if: ${{ always() }}
run: |
if [ "${{ steps.lint-pr-title.outcome }}" == "failure" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "invalid-title"
else
gh pr edit ${{ github.event.pull_request.number }} --remove-label "invalid-title"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading