Skip to content

Commit 748819f

Browse files
committed
Use check-up-to-dateness
1 parent c48de12 commit 748819f

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,20 @@ env:
1515
CARGO_TERM_COLOR: always
1616

1717
jobs:
18-
maybe-expedite:
18+
check-up-to-dateness:
1919
outputs:
20-
value: ${{ steps.expedite.outputs.value }}
20+
is-up-to-date: ${{ steps.main.outputs.is-up-to-date }}
2121

2222
runs-on: ubuntu-latest
2323

2424
steps:
25-
- name: Log github refs
26-
run: |
27-
echo '```' >> "$GITHUB_STEP_SUMMARY"
28-
echo 'github.ref: ${{ github.ref }}' >> "$GITHUB_STEP_SUMMARY"
29-
echo 'github.sha: ${{ github.sha }}' >> "$GITHUB_STEP_SUMMARY"
30-
echo '```' >> "$GITHUB_STEP_SUMMARY"
31-
32-
- uses: actions/checkout@v4
33-
with:
34-
fetch-depth: 0
35-
36-
- name: Check if merging an up-to-date branch
37-
if: ${{ github.event_name == 'merge_group' }}
38-
id: expedite
39-
run: |
40-
N="$(expr "${{ github.ref }}" : '.*-\([0-9]\+\)-[^-]*$')"
41-
BASE_SHA="$(gh api /repos/${{ github.repository }}/pulls/"$N" | jq -r '.base.sha')"
42-
if git diff --quiet ${{ github.event.merge_group.base_sha }} "$BASE_SHA"; then
43-
echo "value=1" >> "$GITHUB_OUTPUT"
44-
fi
45-
env:
46-
GH_TOKEN: ${{ github.token }}
25+
- id: main
26+
uses: trailofbits/check-up-to-dateness@v1
4727

4828
test:
49-
needs: [maybe-expedite]
29+
needs: [check-up-to-dateness]
5030

51-
if: ${{ ! needs.maybe-expedite.outputs.value }}
31+
if: needs.check-up-to-dateness.outputs.is-up-to-date != 'true'
5232

5333
strategy:
5434
fail-fast: ${{ github.event_name == 'merge_group' }}

0 commit comments

Comments
 (0)