Comments (10)
Yes! I love that idea! 😃
from labels.
🤖 Mariatta was mentioned, but she's out of open source until end of September 2019. Hopefully someone else can look into this in the meantime.
from labels.
👋 @Mariatta
I'm curious about how the app would work? What events would it be responding to?
from labels.
Hi @michaeljoseph! 👋
Mariatta and I chatted about how the GitHub app would work offline and we came up with the following design. 📝
Adding the app
When the app is added to a GitHub repo it will check for a labels file on the repo's default branch.
- If it can't find one it will use
fetch
to create one based on the repo's GitHub labels and commit the file on the repo's default branch. - If it can find one it will use
fetch
to update it based on the repo's GitHub labels and commit the changed file to the repo's default branch.
GitHub label event
When a user modifies a GitHub label of a repo, the labels app will react to event and use fetch
to update the labels file and commit the changed file to the repo's default branch.
GitHub push event
When a users pushes commits to the repo's default branch, the labels app will react to the event and check whether the commit modifies the labels file.
If the file was modified, the labels app will use sync
to update the repo's GitHub labels and commit the changed labels file (sync
updates the labels file, so that TOML section names match the name
parameter).
GitHub pull request event
When a new pull-request is created, the labels app will react to the event and check whether it modifies the labels file.
If the file was modified, the labels app use sync
with the dryrun
option and comment on the pull-request how merging the pull-request would change the repo's GitHub labels.
I think it would be really cool if we could implement this idea as a GitHub Action! 🤖
I'm curious to hear what you think about our design!
from labels.
Other use cases
(notes from @Mariatta and my chat at PyCon DE)
- import from another repository
- export to other repositories
- keep labels in sync across repositories in org (select labels)
from labels.
🤖 Mariatta was mentioned, but she's out of open source until end of September 2019. Hopefully someone else can look into this in the meantime.
from labels.
What do you think @michaeljoseph? 😃
from labels.
I just noticed that there is a GitHub Action based on labels
: https://github.com/marketplace/actions/manage-issue-labels
It looks like it allows defining a master repo that pushes out labels to multiple other repos, but I couldn't figure out exactly how that works yet.
from labels.
@jean I created it. You can define labels in .github/labels.toml
(default) and use it as
on:
push:
branches:
- master
name: labels
jobs:
labels:
name: labels
runs-on: ubuntu-latest
steps:
- name: sync labels
uses: tprasadtp/labels@master # Prefer using a tagged version!!!
with:
token: ${{ secrets.GITHUB_TOKEN }}
It will sync the labels, for the repo in which actions is being executed. To manage labels for multiple repos in a single workflow, you have to use builds matrix and a Personal Access Token.
jobs:
labels:
name: labels
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
repo: [ "repo1", "repo2", "repo3", "repo4"]
steps:
- uses: actions/checkout@v2
- name: sync labels
uses: tprasadtp/labels@master # Prefer using a tagged version!!!
with:
file: .github/labels.toml
repo: ${{ matrix.repo }}
token: ${{ secrets.PAT }}
Note: It only works on x86_64 and Linux.
from labels.
I've setup a GitHub action in my projects to run labels
on push to main, when the changes look relevant. I'm pretty sure I copied it from somewhere else a while back, but I can't remember where...
name: Sync Github labels
on:
push:
branches:
- main
paths:
- ".github/**"
jobs:
labels:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install labels
run: pip install labels
- name: Sync config with Github
run: labels -u ${{ github.repository_owner }} -t ${{ secrets.GITHUB_TOKEN }} sync -f .github/labels.toml
I recently managed to tweak it with the right permissions, so it works with the native GITHUB_TOKEN
, scoped to give write access to the issues
.
I've put together pull request #36 to simplify the user-land setup a bit and document its usage.
Suggestions welcome!
from labels.
Related Issues (19)
- Update contributing guide
- Add -f, --file FILENAME option HOT 8
- Add Code of Conduct HOT 1
- Infer labels owner and repo from git in working directory HOT 1
- Feature Request: label issues HOT 2
- Add Python 3.7 to package, docs, and tests HOT 2
- A few Proposal(s) : CLI args improvement, GitHub Enterprise support HOT 2
- Feature request: merge labels HOT 3
- Don't `exit` during a dry run? HOT 1
- Handle differences in capitalisation HOT 3
- Don't `exit` if a renamed label wasn't found
- Switch to Calendar Versioning 📅 HOT 1
- [Feature proposal]: Reuse same color for multiple labels
- Switch to a different TOML parser? 📦
- Rename default branch to main 📋 HOT 1
- Fix broken CI checks 🤖
- Run CI checks on newer Python 3 environments 🤖
- Update GitHub Actions workflow events 🤖
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labels.