-
-
Notifications
You must be signed in to change notification settings - Fork 860
54 lines (52 loc) · 2.04 KB
/
auto-merge-release-updates.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
name: Dependabot auto-merge release-updates
on: pull_request
# Based on https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
name: Clone self repository
with:
ref: ${{ github.head_ref }}
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Update latest releases
id: latest
run: python _auto/latest.py
- uses: stefanzweifel/git-auto-commit-action@v4
name: Update latest and latestReleaseDate
with:
file_pattern: products/*
commit_message: "🤖: Update latest release data"
status_options: '--untracked-files=no'
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'
# TODO: Leave a comment if there is a new major release that we don't match
- name: Enable auto-merge for Dependabot PRs for release data
if: ${{contains(steps.metadata.outputs.dependency-names, '_data/release-data')}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Comment on PR about missing releases
uses: github-actions-up-and-running/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
:warning: The following recent releases are not listed:
```
${{ steps.latest.outputs.warning }}
```