-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
3 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
17 changes: 14 additions & 3 deletions
17
.../check_star_for_challenge_submission.yaml → .github/workflows/checks_for_submission.yaml
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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
name: Check star for a prompt challenge submission | ||
name: Checks for prompt eng challenge submission. | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
is-stargazer: | ||
has-valid-submission: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: dorny/[email protected] | ||
- name: Check if there are any changes in submissions dir | ||
uses: dorny/[email protected] | ||
id: changes | ||
with: | ||
filters: | | ||
src: | ||
- '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.') | ||
|
||
- uses: gacts/[email protected] | ||
id: check-star | ||
|
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
- 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.') | ||
script: core.setFailed('More than one submissions are not allowed at once.') | ||
|
||
# Update leaderboard only if single file is changed in submission dir | ||
- if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }} | ||
|
@@ -58,28 +58,11 @@ jobs: | |
filename_without_extension="${filename%.*}" # Remove extension | ||
python -m scripts.leaderboard --github_user="${{ github.actor }}" --prompt="$filename_without_extension" | ||
- name: Commit changes | ||
- if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }} | ||
name: Commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: GitHub Actions | ||
author_email: [email protected] | ||
message: 'Updated leader board' | ||
add: 'session_2/challenge/leaderboard.md' | ||
|
||
# # Commit the updated leaderboard | ||
# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }} | ||
# name: Commit updated leaderboard | ||
# id: commit-leaderboard | ||
# run: | | ||
# git config --global user.name "GitHub Actions" | ||
# git config --global user.email "[email protected]" | ||
# git add session_2/challenge/leaderboard.md | ||
# git commit -m "Update leaderboard" | ||
# git push -f origin HEAD:${{ github.ref }} | ||
|
||
|
||
# # Print the commit SHA for reference | ||
# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }} | ||
# name: Print Commit SHA | ||
# run: | | ||
# echo "Commit SHA: ${{ steps.commit-leaderboard.outputs.commit_sha }}" | ||
add: 'session_2/challenge/leaderboard.md' |
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