Comments (6)
Seems like this might be highly specific to a particular project - you could automate this using other github actions or by creating a dedicated probot app for this.
from action.
Hmm I see. Do you mean something like https://github.com/actions/labeler? Personally I don't feel like wanting to have labels on Changeset PRs is an uncommon use case, I think it'd be nice to have "all batteries included".
But seeing how easy it is to compose actions, maybe that's a better approach.
from action.
we used actions/github-script@v4
action for this, works pretty fine and easy to setup:
- name: Add label to "Version Package" PR
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
// Get list of all open PRs with
// head branch "changeset-release/master"
// (there should be max 1 PR with such condition)
const { data } = await github.pulls.list({
owner: 'owner',
repo: 'repoName',
state: 'open',
head: `{repoName}:changeset-release/master`
})
for await (let pr of data) {
github.issues.addLabels({
owner: 'owner',
repo: 'repoName',
issue_number: pr.number,
labels: [
'some-label'
]
})
}
from action.
Alternatively you could also use the GitHub CLI which is available in all actions:
jobs:
label:
name: Adds labels to PRs
steps:
- run: gh pr edit --add-label "label name" "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Not sure if this one is required
from action.
Alternatively you could also use the GitHub CLI which is available in all actions:
TIL, nice!
With that in place - it really feels like something that can be handled externally. We could use a "recipe" for this in the README though if anyone wants to prepare one.
from action.
I have a use case where it would be helpful if this was just part of the changesets action.
Specifically I'd like to add an "automerge" label if the changeset only contains patch changes. Would use it like this:
- name: Check for Patch Changes
id: check_patch
run: |
if yarn changeset status | grep -q "info Packages to be bumped at patch"; then
echo "::set-output name=label::automerge"
else
echo "::set-output name=label::"
fi
- name: create or publish changeset
id: create-or-publish-changeset
uses: changesets/action@v1
env:
GITHUB_TOKEN: [redacted]
with:
commit: "chore: update package version"
label: ${{steps.check_patch.outputs.label}}
publish: "yarn release"
setupGitUser: false
title: "chore: update package version"
from action.
Related Issues (20)
- Feature request: Link release to pull request
- Upgrade action to use node20
- TypeError: Cannot read properties of null (reading 'author') HOT 1
- Action fails with output of dist/index.js and without error HOT 3
- Automatically Create Betas
- Publish not working for internal Artifactory registry HOT 4
- Workflow of git action throw error while we setup `type:module` on package.json HOT 2
- Avoid marking releases as Latest
- Github action fail with changeset publish
- Error "No user .npmrc file found" when file actually exists HOT 2
- Any plans to verify changesets org w/ GitHub and publish to Marketplace
- pathspec 'changeset-release/main' did not match any file(s) known to git HOT 4
- HttpError: Not Found HOT 9
- There is no .changeset folder
- How can I change release body content and title?
- actuon HOT 1
- action
- Major version bump where minor is set HOT 1
- useCalculatedVersion option not working HOT 1
- Support private registry
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 action.