Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/1.0.x' into 1.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 13, 2021
2 parents 9d2a03b + ab033a2 commit 90ef879
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ _extends: .github

repository:
name: auto-merge-action
description: Automerge labeled GitHub Pull Requests.
description: 🤖 Automerge labeled GitHub Pull Requests.
topics: console, merge, automerge, action, automation, github-actions
19 changes: 19 additions & 0 deletions .github/workflows/automatic-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Automatic Merge"

on:
schedule:
- cron: '0 * * * *'

jobs:
merge:
name: "Merge Pull Requests"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Merge"
uses: "./"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
17 changes: 0 additions & 17 deletions .github/workflows/automerge.yml

This file was deleted.

26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.0.0 - TBD

### Added

- Nothing.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
GitHub AutoMerge Action
=======================

[![License](https://poser.pugx.org/nucleos/auto-merge-action/license)](LICENSE.md)

[![Continuous Integration](https://github.com/nucleos/auto-merge-action/workflows/Continuous%20Integration/badge.svg?event=push)](https://github.com/nucleos/auto-merge-action/actions?query=workflow%3A"Continuous+Integration"+event%3Apush)
[![Code Coverage](https://codecov.io/gh/nucleos/auto-merge-action/graph/badge.svg)](https://codecov.io/gh/nucleos/auto-merge-action)
[![Type Coverage](https://shepherd.dev/github/nucleos/auto-merge-action/coverage.svg)](https://shepherd.dev/github/nucleos/auto-merge-action)

This GitHub action will scan all open pull requests in the current project and merge them.

The pull request needs to be mergeable (no conflicts), got a green build and contains a label (default: `automerge`).
If the pull request contains an ignore label (default: `wip`), the pull request will be skipped.

The action is designed to run asynchronously (e.g. every hour, once a day), so it can take a few minutes after the pull request got merged.

## Usage

You can create a new workflow that runs every day at 10 AM.

You should not use a very short interval otherwise you will reach the GitHub API limit.

```yaml
# .github/workflows/auto-merge.yml
# .github/workflows/automatic-merge.yml
name: "Automatic Merge"

on:
schedule:
- cron: '0 * * * *'

name: "Automerge Pull Requests"

jobs:
merge:
name: "Merge labeled PRs"
name: "Merge Pull Requests"
runs-on: ubuntu-latest

steps:
- name: "Automerge Action"
uses: docker://nucleos/auto-merge-action
- name: "Merge"
uses: "nucleos/auto-merge-action@1"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
```
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Definition of the github action
# as per https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action

name: 'nucleos/auto-merge-action'
name: 'GitHub AutoMerge Action'
description: 'Automerge labeled GitHub Pull Requests.'

branding:
icon: 'git-merge'
color: 'green'

inputs:
label:
description: 'Label that indicates a pull request for merge.'
Expand Down
4 changes: 3 additions & 1 deletion auto-merge
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use Nucleos\AutoMergeAction\Command\MergeCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Dotenv\Dotenv;

(new Dotenv())->bootEnv(__DIR__ .'/.env');
if (file_exists(__DIR__ .'/.env')) {
(new Dotenv())->bootEnv(__DIR__.'/.env');
}

$client = new Client();
$client->authenticate($_ENV['GITHUB_TOKEN'], null, 'access_token_header');
Expand Down
35 changes: 35 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="My first PHPMD rule set" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="8"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/NPathComplexity">
<properties>
<property name="minimum" value="20"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
<property name="minimum" value="50"/>
<property name="ignore-whitespace" value="true"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveClassLength">
<properties>
<property name="minimum" value="500"/>
<property name="ignore-whitespace" value="true"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
<properties>
<property name="minimum" value="10"/>
</properties>
</rule>
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
<properties>
<property name="maxmethods" value="10"/>
</properties>
</rule>
</ruleset>
1 change: 1 addition & 0 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"jangregor/phpstan-prophecy": "^0.8",
"maglnet/composer-require-checker": "^3.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpmd/phpmd": "^2.9",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12",
Expand Down
142 changes: 141 additions & 1 deletion vendor-bin/tools/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 90ef879

Please sign in to comment.