-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Sion Kang <[email protected]> Co-authored-by: Copilot <[email protected]>
- Loading branch information
1 parent
423b1a3
commit 778ea71
Showing
2 changed files
with
40 additions
and
4 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
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,33 @@ | ||
name: skip-ci | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, unlabeled] | ||
|
||
jobs: | ||
skip_ci: | ||
if: contains(github.event.pull_request.labels.*.name, 'skip:ci') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
token: ${{ secrets.OCTODOG }} | ||
- name: Skip CI | ||
if: github.event.action == 'labeled' | ||
run: | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "octodog" | ||
git commit --allow-empty -m "skip:ci" | ||
git push | ||
- name: Revoke skip:ci | ||
if: github.event.action == 'unlabeled' | ||
run: | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "octodog" | ||
previous_commit_message=$(git log -n 1 --pretty=format:%s --skip 1) | ||
if [[ "$previous_commit_message" == "skip:ci" ]]; then | ||
git log -n 1 --pretty=format:%H --skip 1 | xargs git revert --no-edit | ||
git push | ||
fi |