generated from remal-github-actions/template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.45 KB
/
check-action-secrets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Check action secrets
on:
push:
paths:
- '.github/workflows/*.yml'
branches:
- 'main'
- 'master'
schedule:
- cron: '32 22 * * *' # sync-with-template: adjust
workflow_dispatch: { }
defaults:
run:
shell: bash
jobs:
check-action-secrets:
name: Check action secrets
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: check-action-secrets
cancel-in-progress: true
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: rate-limits
with:
githubToken: ${{secrets.LIST_SECRETS || github.token}}
- name: Make rate limits decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
echo "::warning::Not enough rate limits!"
if [ "${{github.event_name != 'schedule'}}" == "true" ]; then
echo "::warning::Executing anyway, as event is '${{github.event_name}}'"
fi
echo 'enough=false' >> $GITHUB_OUTPUT
fi
- name: Check action secrets
if: ${{github.event_name != 'schedule' || fromJSON(steps.decision.outputs.enough) == true}}
uses: remal-github-actions/check-action-secrets@v1
with:
githubToken: ${{secrets.LIST_SECRETS}}