Skip to content

update lb action

update lb action #17

name: Update File After PR Closed
on:
push:
branches:
- development
jobs:
update-file:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get list of changed files in submissions directory
id: changes
run: |
git diff --name-only HEAD^..HEAD | grep 'session_2/challenge/submissions/' > changed_files.txt
file_count=$(wc -l < changed_files.txt)
echo "::set-output name=file_list::$(cat changed_files.txt)"
echo "::set-output name=file_count::$file_count"
- name: Print list of changed files
run: echo "List of changed files: ${{ steps.changes.outputs.file_list }}"

Check failure on line 23 in .github/workflows/update_leaderboard_after_merge.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/update_leaderboard_after_merge.yaml

Invalid workflow file

You have an error in your yaml syntax on line 23
- name: Print count of changed files
run: echo "Count of changed files: ${{ steps.changes.outputs.file_count }}"
- if: ${{ (steps.changes.outputs.file_count > 1) }}
uses: actions/github-script@v7
with:
script: core.setFailed('More than one submissions are not allowed at once.')
# - name: Update file
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
# run: |
# git config --global user.name "GitHub Actions"
# git config --global user.email "[email protected]"
# echo "Updated content" > hello.txt
# git add hello.txt
# git commit -m "Update file after PR merge"
# git push origin HEAD:${{ github.base_ref }}