-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (40 loc) · 1.54 KB
/
update_leaderboard_after_merge.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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: Check if there are any changes in submissions dir
uses: dorny/[email protected]
id: changes
with:
# Use context to get the branch where commits were pushed.
# If there is only one long-lived branch (e.g. master),
# you can specify it directly.
# If it's not configured, the repository default branch is used.
base: ${{ github.ref }}
filters: |
src:
- added|modified: 'session_2/challenge/submissions/**'
list-files: "shell"
- name: Print changed files
run: |
echo '${{ toJSON(steps.changes.outputs) }}'
- if: ${{ (steps.changes.outputs.src_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 }}