Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
seikhchilli committed May 3, 2024
1 parent 7e648a6 commit a8ef62f
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions .github/workflows/UpdateReadmeOnPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit a8ef62f

Please sign in to comment.