generated from remal-gradle-plugins/template
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.64 KB
/
rebase-dependabot-pull-requests.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
52
53
54
55
56
name: Rebase Dependabot pull requests
on:
push:
paths:
- '.github/workflows/rebase-dependabot-pull-requests.yml'
branches:
- 'main'
- 'master'
schedule:
- cron: '52 1/4 * * *' # sync-with-template: adjust
workflow_dispatch: { }
defaults:
run:
shell: bash
env:
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN || github.token}}
jobs:
rebase-dependabot-pull-requests:
name: Rebase Dependabot pull requests
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: rebase-dependabot-pull-requests
cancel-in-progress: true
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: rate-limits
with:
githubToken: ${{env.PUSH_BACK_TOKEN || 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}}'"
echo 'enough=true' >> $GITHUB_OUTPUT
else
echo 'enough=false' >> $GITHUB_OUTPUT
fi
fi
- name: Rebase Dependabot pull requests
if: ${{fromJSON(steps.decision.outputs.enough) == true}}
uses: remal-github-actions/rebase-dependabot-pull-requests@v1
with:
githubToken: ${{env.PUSH_BACK_TOKEN}}