forked from release-drafter/release-drafter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1a3eb69
Showing
26 changed files
with
5,595 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
steps: | ||
- label: ":node:" | ||
command: "npm test" | ||
plugins: | ||
docker-compose#v2.4.1: | ||
run: app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
design | ||
node_modules | ||
.env | ||
.env.example | ||
coverage | ||
.buildkite | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# The ID of your GitHub App | ||
APP_ID=13956 | ||
WEBHOOK_SECRET=development | ||
|
||
# Use `trace` to get verbose logging or `info` to show less | ||
LOG_LEVEL=debug | ||
|
||
# Go to https://smee.io/new set this to the URL that you are redirected to. | ||
WEBHOOK_PROXY_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
npm-debug.log | ||
*.pem | ||
.env | ||
coverage | ||
now.json | ||
docker-compose-logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: node_js | ||
node_js: | ||
- "10" | ||
sudo: required | ||
services: | ||
- docker | ||
before_script: | ||
# Buildkite step runner | ||
- npm install -g bksr | ||
# The buildkite agent itself | ||
- curl https://download.buildkite.com/agent/stable/latest/buildkite-agent-linux-amd64 > buildkite-agent | ||
- chmod +x buildkite-agent | ||
- sudo mv buildkite-agent /usr/local/bin/buildkite-agent | ||
script: | ||
# Run all the steps defined in .buildkite/pipeline.yml | ||
bksr --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Contributing | ||
|
||
[fork]: /fork | ||
[pr]: /compare | ||
[style]: https://standardjs.com/ | ||
[code-of-conduct]: CODE_OF_CONDUCT.md | ||
|
||
Hi there! I'm thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. | ||
|
||
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. | ||
|
||
## Submitting a pull request | ||
|
||
1. [Fork][fork] and clone the repository | ||
1. Configure and install the dependencies: `npm install` | ||
1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so no need to lint seperately | ||
1. Create a new branch: `git checkout -b my-branch-name` | ||
1. Make your change, add tests, and make sure the tests still pass | ||
1. Push to your fork and [submit a pull request][pr] | ||
1. Give yourself a high five, and wait for your pull request to be reviewed and merged. | ||
|
||
Here are a few things you can do that will increase the likelihood of your pull request being accepted: | ||
|
||
- Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `npm test` | ||
- Write and update tests. | ||
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. | ||
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). | ||
|
||
Work in Progress pull request are also welcome to get feedback early on, or if there is something blocked you. | ||
|
||
## Resources | ||
|
||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) | ||
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) | ||
- [GitHub Help](https://help.github.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:10-alpine@sha256:21b58de0d309e8b793fb508e610762e522074a3bd5bef6f3ff74b7bade338aec | ||
WORKDIR /src | ||
ADD yarn.lock package.json /src/ | ||
RUN yarn | ||
ADD . /src | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ISC License | ||
|
||
Copyright (c) 2018, Tim Lucas | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<h1 align="center"> | ||
<img src="design/logo.svg" alt="Draftah Logo" width="350" /> | ||
</h1> | ||
|
||
<p align="center">Bump version numbers in files whenever new releases are published to GitHub. Built with <a href="https://github.com/probot/probot">Probot</a>.</p> | ||
|
||
--- | ||
|
||
<p align="center"><a href="https://github.com/apps/draftah-bot"><img src="design/install-button.svg" alt="Install the GitHub App" /></a></p> | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
Firstly, you’ll need to install the [Draftah GitHub App](https://github.com/apps/draftah-bot). This listens out for any releases, or any changes to the configuration. | ||
|
||
Then, add a `.github/draftah.yml` configuration file to the GitHub repository where you publish new releases to. | ||
|
||
For example, given the following `.github/draftah.yml` file: | ||
|
||
```yml | ||
updates: | ||
- path: README.md | ||
pattern: 'https://someurl.com/(v.*)/download.zip' | ||
``` | ||
And given the following `README.md` file: | ||
|
||
```markdown | ||
Install with `curl https://someurl.com/v1.0.0/download.zip` | ||
``` | ||
|
||
Then when a new release is published (e.g. `v2.0.0`), Draftah will update the `README.md` to: | ||
|
||
```markdown | ||
Install with `curl https://someurl.com/v2.0.0/download.zip` | ||
``` | ||
|
||
## Examples | ||
|
||
### [Buildkite Plugin Readmes](https://buildkite.com/docs/agent/v3/plugins) | ||
|
||
```yml | ||
updates: | ||
- path: README.md | ||
pattern: 'my-org/my-plugin#(v.*):' | ||
``` | ||
## Configuration options | ||
You can configure Draftah using the following key in your `.github/draftah.yml` file: | ||
|
||
|Key|Required|Description| | ||
|-|-|-| | ||
|`updates`|Required|A list of paths and patterns to update when a new release is published.| | ||
|`updates.[].path`|Required|The path to the file to update.| | ||
|`updates.[].pattern`|Required|The regular expression containing a single group, which will be used to match and update the version number in the file.| | ||
|`updates.[].branch`|Optional|The branch to update. Default is the repository's default branch (e.g. `master`).| | ||
|`branches`|Optional|The branches to listen for configuration updates to `.github/draftah.yml`. Useful if you want to test the app on a pull request branch. Default is `"master"`.| | ||
|
||
Draftah also supports [Probot Config](https://github.com/probot/probot-config), if you want to store your configuration files in a central repository. | ||
|
||
## Developing | ||
|
||
If you have Node v10+ installed locally, you can run the tests, and a local app, using the following commands: | ||
|
||
```sh | ||
# Install dependencies | ||
yarn | ||
# Run the tests | ||
npm test | ||
# Run the app locally | ||
npm start | ||
``` | ||
|
||
If you don't have Node installed, you can use [Docker Compose](https://docs.docker.com/compose/): | ||
|
||
```sh | ||
# Run the tests | ||
docker-compose run --rm app npm test | ||
``` | ||
|
||
## Contributing | ||
|
||
Third-pary contributions are welcome! 🙏🏼 See [CONTRIBUTING.md](CONTRIBUTING.md) for step-by-step instructions. | ||
|
||
If you need help or have a question, let me know via a GitHub issue. | ||
|
||
## Deployment | ||
|
||
If you want to deploy your own copy of Draftah, follow the [Probot Deployment Guide](https://probot.github.io/docs/deployment/). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: "3.4" | ||
services: | ||
app: | ||
build: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const run = require('./lib/run') | ||
const configName = 'draftah.yml' | ||
|
||
module.exports = robot => { | ||
robot.on('push', async context => { | ||
await run({ robot, context, configName }) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports.mergedPullRequests = async ({ robot, context, branch, previousTag }) => { | ||
robot.log({ previousTag }) | ||
|
||
const commits = await context.github.repos.compareCommits(context.repo({ | ||
base: previousTag, | ||
head: branch | ||
})).then(res => res.data.commits) | ||
|
||
robot.log({ commits: commits.map(c => c.commit.message) }) | ||
|
||
let mergedPrNumbers = [] | ||
|
||
commits.forEach((commit) => { | ||
const match = commit.commit.message.match(/^Merge pull request #([^ ]+)/) | ||
if (match && match[1]) { | ||
mergedPrNumbers.push(match[1]) | ||
} | ||
}) | ||
|
||
const mergedPrs = await Promise.all(mergedPrNumbers.map(number => ( | ||
context.github.pullRequests.get(context.repo({ | ||
number: number | ||
})).then(response => response.data) | ||
))) | ||
|
||
return mergedPrs | ||
} |
Oops, something went wrong.