-
Notifications
You must be signed in to change notification settings - Fork 178
53 lines (43 loc) · 1.79 KB
/
update_buildscript.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
# Checks daily to see if the buildscript is in need of an update
name: Update Buildscript
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # "min hr day month year", so run once per day
jobs:
buildscript-update:
runs-on: ubuntu-latest
# Avoid running this workflow on forks
if: github.repository == 'GregTechCEu/GregTech'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Build
uses: ./.github/actions/build_setup
- name: Run Buildscript Updater
run: ./gradlew updateBuildScript --warning-mode all --build-cache
- name: Get New Buildscript Version
id: version-check
run: |
new_version=$(head -1 build.gradle | sed -r 's|//version: (.*)|\1|g')
echo "NEW_VERSION=$new_version" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.BUILDSCRIPT_UPDATER_TOKEN }}
with:
token: ${{ secrets.BUILDSCRIPT_UPDATER_TOKEN }}
commit-message: 'update build script version to ${{ steps.version-check.outputs.NEW_VERSION }}'
branch: gha-update-buildscript
title: Update build script version to ${{ steps.version-check.outputs.NEW_VERSION }}
body: This pull request is created by the buildscript-update workflow
labels: ignore changelog
- name: Enable Pull-Request Auto-Merge
if: steps.create-pull-request.outputs.pull-request-operation == 'created'
run: gh pr merge --squash --auto "${{ steps.create-pull-request.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.BUILDSCRIPT_UPDATER_TOKEN }}