-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (62 loc) · 1.92 KB
/
update_github_actions.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
57
58
59
60
61
62
---
name: Update GitHub Actions
on:
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- .github/workflows/update_github_actions.yml
- build
- build.bat
- build_system/main.py
- build_system/core/**
- build_system/util/**
- build_system/targets/paths.py
- build_system/targets/dependencies/*
- build_system/targets/dependencies/github/*
schedule:
- cron: 0 3 * * 0
workflow_dispatch:
jobs:
update_github_actions:
name: Update GitHub Actions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: bugfix
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: .version-python
- name: Setup git
uses: fregante/setup-git-user@v2
- name: Generate token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_APP_SECRET }}
- name: Update GitHub Actions
run: |
GITHUB_TOKEN=${{ steps.app-token.outputs.token }} ./build update_github_actions
git add .github/workflows/*.y*ml
- name: Submit pull request
id: pull-request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: Update GitHub Actions.
branch: update-github-actions
title: Update GitHub Actions
labels: bot
assignees: mrapp-ke
body: Update the versions of outdated GitHub Actions.
- name: Enable auto-merge
if: ${{ steps.pull-request.outputs.pull-request-operation == 'created' }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr merge --merge --auto "${{ steps.pull-request.outputs.pull-request-number }}"