Skip to content

Commit

Permalink
revert fetch_diff changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gaymeowing committed Aug 17, 2024
1 parent 518d694 commit ef06565
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 30 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,15 @@ jobs:
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Get files changed
id: files_changed
- name: Fetch diff
id: fetch_diff
shell: bash
run: |
case '${{ github.event_name }}' in
push)
firstCommit='${{ github.event.commits[0].id }}'
lastCommit='${{ github.event.commits[-1].id }}'
;;
pull_request)
firstCommit='${{ github.event.base_ref }}'
lastCommit='${{ github.event.head_ref }}'
;;
esac
diff=$(git diff --name-only --diff-filter=d "${firstCommit}~1" "${lastCommit}");
echo diff >> .diff;
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "diff=(gh pr diff ${{ github.event.pull_request.number }})" >> .diff
else
echo "diff=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }} --header 'Accept: application/vnd.github.v3.diff')" >> .diff
fi
- name: Install Toolchain
run: rokit install --no-trust-check
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/release_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,15 @@ jobs:
- name: Install Toolchain
run: rokit install --no-trust-check

- name: Get files changed
id: files_changed
- name: Fetch diff
id: fetch_diff
shell: bash
run: |
case '${{ github.event_name }}' in
push)
firstCommit='${{ github.event.commits[0].id }}'
lastCommit='${{ github.event.commits[-1].id }}'
;;
pull_request)
firstCommit='${{ github.event.base_ref }}'
lastCommit='${{ github.event.head_ref }}'
;;
esac
diff=$(git diff --name-only --diff-filter=d "${firstCommit}~1" "${lastCommit}");
echo diff >> .diff;
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "diff=(gh pr diff ${{ github.event.pull_request.number }})" >> .diff
else
echo "diff=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }} --header 'Accept: application/vnd.github.v3.diff')" >> .diff
fi
- name: Run releases script
run: lune run scripts/release/make_lib_releases ${{ inputs.libs }}

0 comments on commit ef06565

Please sign in to comment.