Skip to content

Commit 1bf48b0

Browse files
authored
[Actions] Create Rector Action (#20)
1 parent 194dc73 commit 1bf48b0

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

actions/php/rector/action.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Rector
2+
inputs:
3+
branch:
4+
type: string
5+
required: false
6+
default: main
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Set execute permissions
14+
shell: bash
15+
run: chmod +x ${{github.action_path}}/entrypoint.sh
16+
17+
- name: Run Rector
18+
shell: bash
19+
run: ${{github.action_path}}/entrypoint.sh
20+
21+
- uses: stefanzweifel/git-auto-commit-action@v5
22+
id: auto_commit_action
23+
with:
24+
commit_message: Rectifying
25+
commit_user_name: EncoreBot
26+
commit_user_email: [email protected]
27+
28+
- name: Ignore Rector commit in git blame
29+
if: steps.auto_commit_action.outputs.changes_detected == 'true'
30+
run: echo ${{ steps.auto_commit_action.outputs.commit_hash }} >> .git-blame-ignore-revs
31+
32+
- uses: stefanzweifel/git-auto-commit-action@v5
33+
with:
34+
commit_message: Ignore Rector commit in git blame
35+
commit_user_name: EncoreBot
36+
commit_user_email: [email protected]

actions/php/rector/entrypoint.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
echo "Running Rector"
4+
5+
"$GITHUB_WORKSPACE"/vendor/bin/rector process

0 commit comments

Comments
 (0)