Skip to content

Commit 2f9181a

Browse files
committed
add general CI workflows
1 parent 036c5b0 commit 2f9181a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: cleanup caches by a branch
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
14+
- name: Cleanup
15+
run: |
16+
gh extension install actions/gh-actions-cache
17+
18+
REPO=${{ github.repository }}
19+
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
20+
21+
echo "Fetching list of cache key"
22+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
23+
24+
## Setting this to not fail the workflow while deleting cache keys.
25+
set +e
26+
echo "Deleting caches..."
27+
for cacheKey in $cacheKeysForPR
28+
do
29+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
30+
done
31+
echo "Done"
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Enforce License Compliance
2+
3+
on:
4+
pull_request:
5+
branches: [main, master]
6+
7+
jobs:
8+
enforce-license-compliance:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 'Enforce License Compliance'
12+
uses: getsentry/action-enforce-license-compliance@57ba820387a1a9315a46115ee276b2968da51f3d # main
13+
with:
14+
fossa_api_key: ${{ secrets.FOSSA_API_KEY }}

0 commit comments

Comments
 (0)