Skip to content

[Actions] Create Rector Action #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions actions/php/rector/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Rector
inputs:
branch:
type: string
required: false
default: main
runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set execute permissions
shell: bash
run: chmod +x ${{github.action_path}}/entrypoint.sh

- name: Run Rector
shell: bash
run: ${{github.action_path}}/entrypoint.sh

- uses: stefanzweifel/git-auto-commit-action@v5
id: auto_commit_action
with:
commit_message: Rectifying
commit_user_name: EncoreBot
commit_user_email: [email protected]

- name: Ignore Rector commit in git blame
if: steps.auto_commit_action.outputs.changes_detected == 'true'
run: echo ${{ steps.auto_commit_action.outputs.commit_hash }} >> .git-blame-ignore-revs

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Ignore Rector commit in git blame
commit_user_name: EncoreBot
commit_user_email: [email protected]
5 changes: 5 additions & 0 deletions actions/php/rector/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Running Rector"

"$GITHUB_WORKSPACE"/vendor/bin/rector process