-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 parent
7e648a6
commit a8ef62f
Showing
1 changed file
with
14 additions
and
24 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 |
---|---|---|
|
@@ -21,38 +21,28 @@ jobs: | |
with: | ||
python-version: '3.12' | ||
|
||
- name: Check for Allowed File Changes | ||
uses: tj-actions/verify-changed-files@v19 | ||
id: verify-changes | ||
with: | ||
# Only check for changes in Python and C++ files | ||
files: | | ||
**/*.py | ||
**/*.cpp | ||
# Fail if no allowed files changed | ||
|
||
- name: Check File Names | ||
run: | | ||
changed_files=${{ steps.verify-changes.outputs.changed_files }} | ||
echo $changed_files | ||
changed_files=$(git diff --name-only HEAD~1 HEAD) | ||
echo ${{ changed_files }} | ||
for file in $changed_files; do | ||
if [[ ! ($file =~ ^\d+[A-Z]\.(cpp|py)$) ]]; then | ||
echo "Error: File '$file' does not match allowed pattern" | ||
exit 1 | ||
fi | ||
done | ||
- name: Run Python script to update README | ||
run: python update_readme.py ${{ steps.verify-changes.outputs.changed_files }} | ||
# - name: Run Python script to update README | ||
# run: python update_readme.py ${{ steps.verify-changes.outputs.changed_files }} | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
git add README.md | ||
git commit -m "Update README" | ||
# - name: Commit changes | ||
# run: | | ||
# git config --local user.email "[email protected]" | ||
# git config --local user.name "GitHub Actions" | ||
# git add README.md | ||
# git commit -m "Update README" | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.CODEFORCES_GITHUB_TOKEN }} | ||
# - name: Push changes | ||
# uses: ad-m/github-push-action@master | ||
# with: | ||
# github_token: ${{ secrets.CODEFORCES_GITHUB_TOKEN }} |