-
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
Showing
5 changed files
with
116 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,18 @@ | ||
# .github/workflows/release.yml | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
types: closed | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Tag | ||
uses: K-Phoen/semver-release-action@master | ||
with: | ||
release_branch: main | ||
tag_format: "%major%.%minor%.%patch%" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,28 @@ | ||
name: update-reviewdog | ||
on: | ||
schedule: | ||
- cron: '14 14 * * *' | ||
|
||
jobs: | ||
reviewdog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: reviewdog/action-depup@master | ||
id: update-reviewdog | ||
with: | ||
file: action.yml | ||
version_name: REVIEWDOG_VERSION | ||
repo: reviewdog/reviewdog | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: "Update ${{ steps.update-reviewdog.outputs.repo }} to ${{ steps.update-reviewdog.outputs.latest }}" | ||
commit-message: "Update ${{ steps.update-reviewdog.outputs.repo }} to ${{ steps.update-reviewdog.outputs.latest }}" | ||
body: | | ||
Update ${{ steps.update-reviewdog.outputs.repo }} to [${{ steps.update-reviewdog.outputs.latest }}](https://github.com/${{ steps.update-reviewdog.outputs.repo }}/releases/tag/v${{ steps.update-reviewdog.outputs.latest }}) | ||
This PR is auto generated by [update-reviewdog workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}). | ||
branch: update-reviewdog | ||
base: main |
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 |
---|---|---|
@@ -1,2 +1,18 @@ | ||
# action-phpcs | ||
A GitHub action that runs a phpcs and reports the result to reviewdog | ||
|
||
# Prerequisites | ||
* Composer install has been executed | ||
* Phpcs is install by composer and available in the composer config bin-dir | ||
* The code styles used by phpcs are installed and confgured in .phpcs.xml | ||
|
||
# Usage | ||
Add a workflow step with the action: | ||
|
||
```yaml | ||
steps: | ||
- name: Run phpcs | ||
uses: reload/poc-phpcs-reviewdog-action@<VERSION> | ||
with: | ||
reviewdog_token: ${{ secrets.GITHUB_TOKEN }}` | ||
``` |
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,28 @@ | ||
name: 'Phpcs and reviewdog runner' | ||
description: 'This action installs reviewdog 🐶, runs phpcs 🐘 and pipes output to reviewdog. It depends ' | ||
inputs: | ||
reviewdog_token: | ||
description: 'The Github API token needed for Reviewdog' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install phpcs | ||
run: $GITHUB_ACTION_PATH/install.sh | ||
shell: bash | ||
env: | ||
REVIEWDOG_VERSION: 0.10.2 | ||
REVIEWDOG_TEMPDIR: ${{ runner.temp }} | ||
- name: Run phpcs and report to reviewdog | ||
run: | | ||
set +o pipefail | ||
phpcs --config-set ignore_errors_on_exit 1 | ||
phpcs --config-set ignore_warnings_on_exit 1 | ||
$(composer config bin-dir)/phpcs --report=checkstyle \ | ||
| reviewdog -f=checkstyle -name=phpcs -reporter=github-pr-check -fail-on-error=true | ||
shell: bash | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ inputs.reviewdog_token }} | ||
|
||
branding: | ||
icon: 'terminal' | ||
color: 'gray-dark' |
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,26 @@ | ||
#!/bin/bash | ||
|
||
VERSION="${REVIEWDOG_VERSION:-latest}" | ||
|
||
TEMP="${REVIEWDOG_TEMPDIR}" | ||
if [ -z "${TEMP}" ]; then | ||
if [ -n "${RUNNER_TEMP}" ]; then | ||
TEMP="${RUNNER_TEMP}" | ||
else | ||
TEMP="$(mktemp -d)" | ||
fi | ||
fi | ||
|
||
INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh' | ||
if [ "${VERSION}" == 'nightly' ] ; then | ||
INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/nightly/master/install.sh' | ||
VERSION='latest' | ||
fi | ||
|
||
mkdir -p "${TEMP}/reviewdog/bin" | ||
|
||
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' | ||
curl -sfL "${INSTALL_SCRIPT}" | sh -s -- -b "${TEMP}/reviewdog/bin" "${VERSION}" 2>&1 | ||
echo '::endgroup::' | ||
|
||
echo "${TEMP}/reviewdog/bin" >>"${GITHUB_PATH}" |