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

chore: add label on pr automatically #342

Merged
merged 42 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6a00164
Create main.yml
tilucasoli Jun 28, 2024
57f20a6
testing
tilucasoli Jun 28, 2024
bef57d6
change
tilucasoli Jun 28, 2024
9c26b5f
Update add_label.yml
tilucasoli Jun 28, 2024
e8c33cf
Update add_label.yml
tilucasoli Jun 28, 2024
e7ef1ee
Update add_label.yml
tilucasoli Jun 28, 2024
94277ea
Update add_label.yml
tilucasoli Jun 28, 2024
dc82e92
Update add_label.yml
tilucasoli Jun 28, 2024
c7543b8
Update add_label.yml
tilucasoli Jun 28, 2024
cd911bf
Update add_label.yml
tilucasoli Jun 28, 2024
d7042eb
Update add_label.yml
tilucasoli Jun 28, 2024
8b91fac
Update add_label.yml
tilucasoli Jun 28, 2024
2c6c776
Update add_label.yml
tilucasoli Jun 28, 2024
7c56996
Update add_label.yml
tilucasoli Jun 28, 2024
1855d36
Update add_label.yml
tilucasoli Jun 28, 2024
8635582
Update add_label.yml
tilucasoli Jun 28, 2024
5021bc0
Update add_label.yml
tilucasoli Jun 28, 2024
d1ca5e4
Update add_label.yml
tilucasoli Jun 28, 2024
e77a460
Update add_label.yml
tilucasoli Jun 28, 2024
62e600e
Update add_label.yml
tilucasoli Jun 28, 2024
ab71cb3
Update add_label.yml
tilucasoli Jun 28, 2024
7cfb664
Update add_label.yml
tilucasoli Jun 28, 2024
38cedf1
Update add_label.yml
tilucasoli Jun 28, 2024
8a28a36
Update add_label.yml
tilucasoli Jun 28, 2024
0364182
Update add_label.yml
tilucasoli Jun 28, 2024
e383d39
Update add_label.yml
tilucasoli Jun 28, 2024
bcdcc3b
Revert "testing"
tilucasoli Jun 28, 2024
a1b28c8
Update add_label.yml
tilucasoli Jun 28, 2024
a7bc96b
Update add_label.yml
tilucasoli Jun 28, 2024
39d1ffa
Update add_label.yml
tilucasoli Jun 28, 2024
dceb051
Update add_label.yml
tilucasoli Jun 28, 2024
70da42c
Update add_label.yml
tilucasoli Jun 28, 2024
52ae1f2
Update add_label.yml
tilucasoli Jun 28, 2024
d81dbc1
Update add_label.yml
tilucasoli Jun 28, 2024
54c0aeb
Update add_label.yml
tilucasoli Jun 28, 2024
5c1208c
Update add_label.yml
tilucasoli Jun 28, 2024
b82e661
Update add_label.yml
tilucasoli Jun 28, 2024
0063ac2
Update add_label.yml
tilucasoli Jun 28, 2024
3d90fef
Update add_label.yml
tilucasoli Jun 28, 2024
b07a027
Update CHANGELOG.md
tilucasoli Jun 28, 2024
6a8bd4b
Revert "Update CHANGELOG.md"
tilucasoli Jun 28, 2024
a70cf56
tests
tilucasoli Jun 28, 2024
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
62 changes: 62 additions & 0 deletions .github/workflows/add_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Add labels"

on:
pull_request:

permissions:
pull-requests: write

jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- uses: rogerluan/[email protected]
with:
github_token: ${{ secrets.github_token }}

- uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process')
const { commits } = context.payload.pull_request
const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString()
const files = rawFiles.split('\n').filter(Boolean)

// verify packages
const packagesFiles = files.filter(file => file.startsWith('packages/') && !file.includes('mix_lint_test'))
const packages = packagesFiles.map(file => file.split('/')[1])
const labels = Array.from(new Set(packages))

// verify documentation
const wasDocModified = files.filter(file => file.startsWith('website/')).length > 0
if (wasDocModified) {
labels.push('documentation')
}

// verify examples
const wasExampleModified = files.filter(file => file.startsWith('examples/')).length > 0
if (wasExampleModified) {
labels.push('examples')
}

// verify repo
const wasRepoModified = files.filter(file => !file.startsWith('website/') && !file.startsWith('packages/') && !file.startsWith('examples/')).length > 0
if (wasRepoModified) {
labels.push('repo')
}

console.log(labels)

github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
})


Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mix/mix.dart';

// Wrong case
final theme = MixThemeData(
final wrongTheme = MixThemeData(
colors: {
// expect_lint: mix_avoid_defining_tokens_within_theme_data
ColorToken('a'): Colors.black,
Expand Down Expand Up @@ -34,7 +34,7 @@ final radiusToken = RadiusToken('c');
final spaceToken = SpaceToken('d');
final textStyleToken = TextStyleToken('e');

final otherTheme = MixThemeData(
final correctTheme = MixThemeData(
colors: {
colorToken: Colors.black,
},
Expand Down
2 changes: 1 addition & 1 deletion website/pages/docs/guides/animations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Animations"
---

# Animations

In this guide, we will learn how animations work in Mix. Firstly, we need to understand how Mix styles work. All stylizations begin with the `Style` class.

## Style Class
Expand Down
Loading