octue / generate-pull-request-description Goto Github PK
View Code? Open in Web Editor NEWA GitHub action that updates PR descriptions from Conventional Commits
A GitHub action that updates PR descriptions from Conventional Commits
I love the idea to auto generate the PR based on commit messages, that's how I end up here.
I'm trying to use it for my own repo, but gives the following error:
Error: Unable to resolve action riskledger/update-pr-description@dev
, unable to find version dev
I solved it by updating the text to:
riskledger/update-pr-description@v2
It does not follow the latest v1.0.0 conventional commits types.
From the code, it supports the following types:
COMMIT_CODES_TO_HEADINGS_MAPPING = {
"FEA": "### New features",
"ENH": "### Enhancements",
"FIX": "### Fixes",
"OPS": "### Operations",
"DEP": "### Dependencies",
"REF": "### Refactoring",
"TST": "### Testing",
"MRG": OTHER_SECTION_HEADING,
"REV": "### Reversions",
"CHO": "### Chores",
"STY": "### Style",
"WIP": OTHER_SECTION_HEADING,
"DOC": OTHER_SECTION_HEADING,
}
But the conventional commits specification have different types and lowercased.
Other than that, it works great! Thank you for your efforts!
We are trying to use your GitHub action but it doesn't work exactly as needed at the minute - we could potentially submit PRs to fix this if you are open to that
Action throws error:
Traceback (most recent call last):
File "/usr/local/bin/generate-pull-request-description", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/generate_pull_request_description/generate_pull_request_description.py", line 459, in main
).generate()
File "/usr/local/lib/python3.10/site-packages/generate_pull_request_description/generate_pull_request_description.py", line 116, in generate
parsed_commits, unparsed_commits = self._parse_commit_messages_from_github()
File "/usr/local/lib/python3.10/site-packages/generate_pull_request_description/generate_pull_request_description.py", line 249, in _parse_commit_messages_from_github
header, *body = commit["commit"]["message"].split("\n")
TypeError: string indices must be integers
Not to throw the error
Hey, you might want to add cherry-pick this from me
Firtzberg@71cb859
We want to be able to reuse the text output in subsequent jobs or reusable workflows
Current usage instructions look like this:
- uses: octue/[email protected]
with:
pull_request_url: ${{ github.event.pull_request.url }}
api_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update pull request body
uses: riskledger/update-pr-description@v2
with:
body: ${{ env.PULL_REQUEST_DESCRIPTION }}
token: ${{ secrets.GITHUB_TOKEN }}
What's happening is that the action is putting outputs into the github actions env
ironment, visible to all subsequent actions but not usable in subsequent jobs. This comes from before GitHub had a way of dealing with outputs.
GitHub actions now allows steps to run complex commands, including setting outputs which can then be reused in subsequent jobs (only the subsequent jobs where you want them) and reusable workflows like this.
Alter the outputs to be set via command rather than attached to env, update usage instructions accordingly.
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.