marocchino / checkbox-action Goto Github PK
View Code? Open in Web Editor NEWChecks or unchecks a checkbox in the body of the pull request, or returns the list confirming the change in the checkbox.
License: MIT License
Checks or unchecks a checkbox in the body of the pull request, or returns the list confirming the change in the checkbox.
License: MIT License
If a Pr is built from a template, and that template starts any checkbox off as checked, then this action will only return those checkbox items if they are changed.
this action should probably change the output from
outputs = { checked, unchecked }
to
outputs = {
changed: { checked, unchecked },
checked, unchecked
}
so that it properly communicates the intent of the `getDiff` outputs.
Hello,
It looks like this action doesn't handle the case when only the pull request title is changed.
With this trigger the action can be run when the title or the description is changed:
on:
pull_request:
types: [edited]
But when only the title is concerned it seems that the github.context.payload.changes.body
variable (used here) is empty or absent (cf. docs).
Leading to this error:
Run marocchino/checkbox-action@03a47510e9dcd6931775838d362ec698bac07c16
with:
action: detect
error: error
GITHUB_TOKEN: ***
Error: Cannot read properties of undefined (reading 'from')
For some two functions attempting to get body
are failing because github.context.payload.pull_request
is undefined.
When the PR body hasn't changed from its original state, this function fails because changes.body.from
doesn't exist on the context until changes are made to the PR body.
https://github.com/marocchino/checkbox-action/blob/main/src/detect.ts#L7
workflow:
name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
jobs:
DetectCheckboxes:
runs-on: ubuntu-latest
outputs:
checked: ${{ steps.detect.outputs.checked }}
steps:
- uses: marocchino/checkbox-action@v1
id: detect
with:
action: 'detect'
PrintCheckboxes:
needs: DetectCheckboxes
runs-on: ubuntu-latest
steps:
- run: |
echo ${{needs.detect.outputs.checked}}
LintPrTitle:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The PR template :
# Description
## What kind of change is this?
- [ ] bug fix
- [ ] documentation
- [ ] new feature
## Steps to test changes
<!--
It's important that changes proposed are able to be verified by others.
Provide enough information for others to follow. Screenshots are welcome.
//-->
1. Build the app with `command to build`
2. Run the app with `./build/lamp --required-args`
3. Configure the app ...
4. Do this in the app ...
5. Then this ...
6. Observe this in the app ... to confirm changes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.