add IamJayPrakash #1
Workflow file for this run
This file contains hidden or 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
name: Revert contributors.js changes | |
on: | |
pull_request: | |
paths: | |
- 'scripts/contributors.js' | |
jobs: | |
revert-changes: | |
name: Revert changes to contributors.js | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: Revert changes to contributors.js | |
run: | | |
# Check if the file has changed | |
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -q 'scripts/contributors.js'; then | |
echo "Changes detected in scripts/contributors.js - reverting..." | |
git checkout ${{ github.event.pull_request.base.sha }} -- scripts/contributors.js | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git commit -m "Revert changes to scripts/contributors.js [skip ci]" | |
git push | |
echo "Changes to scripts/contributors.js have been reverted." | |
else | |
echo "No changes to scripts/contributors.js detected." | |
fi |