Skip to content

Commit

Permalink
[CI/CD ] Add safe directory (#184)
Browse files Browse the repository at this point in the history
Add a step to enable using git commands on a local repository that is not owned by the current user.
  • Loading branch information
Bowen12992 authored Aug 28, 2024
1 parent 7913bb8 commit 2db4271
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/model-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ jobs:
- 82
options: --gpus all --hostname flag-gems_cicd_model -v /home/flaggems_cicd/huggingface_cache_bert:/__w/_temp/_github_home/.cache/huggingface -v /home/flaggems_cicd/PR_Coverage:/PR_Coverage
steps:
- name: Get commit ID
run: |
git config --global --add safe.directory /__w/FlagGems/FlagGems
COMMIT_ID=$(git rev-parse HEAD)
echo "Commit ID is $COMMIT_ID"
- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -31,6 +25,7 @@ jobs:
- name: FlagGems examples
shell: bash
run: |
git config --global --add safe.directory /__w/FlagGems/FlagGems
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "This is a pull request event. PR number is ${{ github.event.pull_request.number }}"
bash tools/model-test.sh ${{ github.event.pull_request.number }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/op-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- name: FlagGems unit test
shell: bash
run: |
git config --global --add safe.directory /__w/FlagGems/FlagGems
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "This is a pull request event. PR number is ${{ github.event.pull_request.number }}"
bash tools/op-unit-test.sh ${{ github.event.pull_request.number }}
Expand Down

0 comments on commit 2db4271

Please sign in to comment.