-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
name: auto-approve | ||
on: pull_request_target | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
workflow_dispatch: | ||
inputs: | ||
pullRequestNumber: | ||
description: Pull request number to auto-approve | ||
required: false | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
if: github.actor == 'dependabot[bot]' || github.ref == 'refs/heads/platform/update-version-meta-data' || github.event_name == 'workflow_dispatch' | ||
steps: | ||
- uses: hmarr/auto-approve-action@v3 | ||
with: | ||
review-message: "Auto approved automated PR" | ||
pull-request-number: ${{ github.event.inputs.pullRequestNumber }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
name: version-updater | ||
|
||
on: | ||
repository_dispatch: | ||
types: [version-updater] | ||
push: | ||
branches: | ||
- 'platform/update-version-meta-data' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
branchName: | ||
description: Pull request against branch | ||
default: 'platform/update-version-meta-data' | ||
type: choice | ||
options: | ||
- 'platform/update-version-meta-data' | ||
required: true | ||
|
||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
version-updater: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract version | ||
id: version | ||
run: echo "${GITHUB_REF#refs/tags/}" > VERSION | ||
|
||
- name: Calculate version code | ||
id: code | ||
run: | | ||
IFS='.' read -ra VER <<< "$(cat VERSION)" | ||
MAJOR=$((VER[0] * 1000000000)) | ||
MINOR=$((VER[1] * 10000)) | ||
PATCH=${VER[2]} | ||
CODE=$((MAJOR + MINOR + PATCH)) | ||
echo "version=$(cat VERSION)" > gradle/version.properties | ||
echo "code=$CODE" >> gradle/version.properties | ||
echo "name=v$(cat VERSION)" >> gradle/version.properties | ||
- name: Show release info | ||
run: cat gradle/version.properties | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: platform/update-version-meta-data | ||
|
||
- name: Commit version.properties | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add gradle/version.properties | ||
git commit -m "Bump version to $(cat VERSION)" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: develop | ||
directory: . | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "automation: update version.properties" | ||
author: "Author <actions@github.com>" | ||
title: "platform: automated version update" | ||
body: | | ||
This PR was automatically generated to update version.properties. | ||
branch: ${{ github.event.inputs.branchName }} | ||
base: develop | ||
labels: "skip-changelog" | ||
assignees: "wax911" | ||
reviewers: "wax911" |