Skip to content

Commit

Permalink
chore!: 2025-01-04 22:37:06 +0100
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Jan 4, 2025
1 parent 1a0f4dd commit 4ff9487
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,30 @@ jobs:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: List changed files
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

# TODO: Handle weird file names. Store in JSON.
- id: get-changed-files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
done
printf \
'changed_files=%s\n' \
"$(
if ${{ github.event_name == 'pull_request' }}; then
git diff --name-only HEAD~1 HEAD
else
git diff --name-only \
${{ github.event.before }} ${{ github.event.after }}
fi
)" \
>> $GITHUB_OUTPUT
- run: |
for file in ${{ steps.get-changed-files.outputs.changed_files }}; do
printf '[CHANGED] %s\n' "$file"
done
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v8
Expand Down

0 comments on commit 4ff9487

Please sign in to comment.