-
Notifications
You must be signed in to change notification settings - Fork 10
45 lines (40 loc) · 1.58 KB
/
buildscript-maintenance.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
# This workflow only meant for the source mod you shouldn't bring it into your own project
name: Buildscript maintenance
on:
push:
branches: [ master, main ]
paths:
- build.gradle
- settings.gradle
workflow_dispatch: { }
jobs:
buildscript-maintenance:
runs-on: ubuntu-latest
# Avoid running this workflow on forks
if: github.repository == 'GregTechCEu/Buildscripts'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Ensure build script version is up to date
id: update-buildscript
run: |
new_version="$(date +%s)"
sed --in-place "1s!^//version:.*!//version: $new_version!g" build.gradle
echo "::set-output name=new_version::$new_version"
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.BUILDSCRIPT_MAINTENANCE_TOKEN }}
with:
token: ${{ secrets.BUILDSCRIPT_MAINTENANCE_TOKEN }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
add-paths: build.gradle
commit-message: '[ci skip] update build script version to ${{ steps.update-buildscript.outputs.new_version }}'
branch: gha-buildscript-maintenance
title: Update build script version to ${{ steps.update-buildscript.outputs.new_version }}
body: This pull request is created by the buildscript-maintenance workflow